@atlaskit/editor-plugin-type-ahead 17.0.0 → 17.0.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,17 @@
1
1
  # @atlaskit/editor-plugin-type-ahead
2
2
 
3
+ ## 17.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 17.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 17.0.0
4
16
 
5
17
  ### Patch Changes
@@ -35,7 +35,7 @@ var buildTypeAheadMenuModel = exports.buildTypeAheadMenuModel = function buildTy
35
35
  if (section.type !== 'menu-section' || !(0, _surfaceRenderer.willComponentRender)(section, childrenMap, surfaceContext)) {
36
36
  continue;
37
37
  }
38
- var children = (_childrenMap$get = childrenMap.get(section.key)) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : [];
38
+ var children = (_childrenMap$get = childrenMap.get((0, _surfaceRenderer.getComponentIdentity)(section))) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : [];
39
39
  if ((0, _typeAheadIsMenuFooterSectionKey.isMenuFooterSectionKey)(section.key)) {
40
40
  footer = children.find(function (child) {
41
41
  return child.type === 'menu-item' && (0, _surfaceRenderer.willComponentRender)(child, childrenMap, surfaceContext);
@@ -51,7 +51,7 @@ var getMatchingComponents = exports.getMatchingComponents = function getMatching
51
51
  if (section.type !== 'menu-section' || (0, _typeAheadIsMenuFooterSectionKey.isMenuFooterSectionKey)(section.key) || !(0, _surfaceRenderer.willComponentRender)(section, childrenMap, surfaceContext)) {
52
52
  continue;
53
53
  }
54
- var _iterator3 = _createForOfIteratorHelper((_childrenMap$get = childrenMap.get(section.key)) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : []),
54
+ var _iterator3 = _createForOfIteratorHelper((_childrenMap$get = childrenMap.get((0, _surfaceRenderer.getComponentIdentity)(section))) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : []),
55
55
  _step3;
56
56
  try {
57
57
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
@@ -1,6 +1,6 @@
1
1
  import { isMenuFooterSectionKey } from '@atlaskit/editor-common/type-ahead-is-menu-footer-section-key';
2
2
  import { isSectionOverflowItemKey } from '@atlaskit/editor-common/type-ahead-is-section-overflow-item-key';
3
- import { resolveSurface, willComponentRender } from '@atlaskit/editor-ui-control-model/surface-renderer';
3
+ import { getComponentIdentity, resolveSurface, willComponentRender } from '@atlaskit/editor-ui-control-model/surface-renderer';
4
4
  export const buildTypeAheadMenuModel = (components, rootComponent, sectionOverflowLimit, surfaceContext) => {
5
5
  const {
6
6
  root,
@@ -21,7 +21,7 @@ export const buildTypeAheadMenuModel = (components, rootComponent, sectionOverfl
21
21
  if (section.type !== 'menu-section' || !willComponentRender(section, childrenMap, surfaceContext)) {
22
22
  continue;
23
23
  }
24
- const children = (_childrenMap$get = childrenMap.get(section.key)) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : [];
24
+ const children = (_childrenMap$get = childrenMap.get(getComponentIdentity(section))) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : [];
25
25
  if (isMenuFooterSectionKey(section.key)) {
26
26
  footer = children.find(child => child.type === 'menu-item' && willComponentRender(child, childrenMap, surfaceContext));
27
27
  continue;
@@ -1,6 +1,6 @@
1
1
  import { isMenuFooterSectionKey } from '@atlaskit/editor-common/type-ahead-is-menu-footer-section-key';
2
2
  import { isSectionOverflowItemKey } from '@atlaskit/editor-common/type-ahead-is-section-overflow-item-key';
3
- import { resolveSurface, willComponentRender } from '@atlaskit/editor-ui-control-model/surface-renderer';
3
+ import { getComponentIdentity, resolveSurface, willComponentRender } from '@atlaskit/editor-ui-control-model/surface-renderer';
4
4
  const getRank = (component, parentKey) => {
5
5
  var _component$parents$fi, _component$parents, _component$parents$fi2;
6
6
  return (_component$parents$fi = (_component$parents = component.parents) === null || _component$parents === void 0 ? void 0 : (_component$parents$fi2 = _component$parents.find(parent => parent.key === parentKey)) === null || _component$parents$fi2 === void 0 ? void 0 : _component$parents$fi2.rank) !== null && _component$parents$fi !== void 0 ? _component$parents$fi : Number.MAX_SAFE_INTEGER;
@@ -35,7 +35,7 @@ export const getMatchingComponents = ({
35
35
  if (section.type !== 'menu-section' || isMenuFooterSectionKey(section.key) || !willComponentRender(section, childrenMap, surfaceContext)) {
36
36
  continue;
37
37
  }
38
- for (const item of (_childrenMap$get = childrenMap.get(section.key)) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : []) {
38
+ for (const item of (_childrenMap$get = childrenMap.get(getComponentIdentity(section))) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : []) {
39
39
  var _childrenMap$get, _item$match, _match$score;
40
40
  if (item.type !== 'menu-item' || isSectionOverflowItemKey(item.key) || !willComponentRender(item, childrenMap, surfaceContext)) {
41
41
  continue;
@@ -4,7 +4,7 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
4
4
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
5
  import { isMenuFooterSectionKey } from '@atlaskit/editor-common/type-ahead-is-menu-footer-section-key';
6
6
  import { isSectionOverflowItemKey } from '@atlaskit/editor-common/type-ahead-is-section-overflow-item-key';
7
- import { resolveSurface, willComponentRender } from '@atlaskit/editor-ui-control-model/surface-renderer';
7
+ import { getComponentIdentity, resolveSurface, willComponentRender } from '@atlaskit/editor-ui-control-model/surface-renderer';
8
8
  export var buildTypeAheadMenuModel = function buildTypeAheadMenuModel(components, rootComponent, sectionOverflowLimit, surfaceContext) {
9
9
  var _resolveSurface = resolveSurface(components, rootComponent),
10
10
  root = _resolveSurface.root,
@@ -28,7 +28,7 @@ export var buildTypeAheadMenuModel = function buildTypeAheadMenuModel(components
28
28
  if (section.type !== 'menu-section' || !willComponentRender(section, childrenMap, surfaceContext)) {
29
29
  continue;
30
30
  }
31
- var children = (_childrenMap$get = childrenMap.get(section.key)) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : [];
31
+ var children = (_childrenMap$get = childrenMap.get(getComponentIdentity(section))) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : [];
32
32
  if (isMenuFooterSectionKey(section.key)) {
33
33
  footer = children.find(function (child) {
34
34
  return child.type === 'menu-item' && willComponentRender(child, childrenMap, surfaceContext);
@@ -3,7 +3,7 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
3
3
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
4
4
  import { isMenuFooterSectionKey } from '@atlaskit/editor-common/type-ahead-is-menu-footer-section-key';
5
5
  import { isSectionOverflowItemKey } from '@atlaskit/editor-common/type-ahead-is-section-overflow-item-key';
6
- import { resolveSurface, willComponentRender } from '@atlaskit/editor-ui-control-model/surface-renderer';
6
+ import { getComponentIdentity, resolveSurface, willComponentRender } from '@atlaskit/editor-ui-control-model/surface-renderer';
7
7
  var getRank = function getRank(component, parentKey) {
8
8
  var _component$parents$fi, _component$parents;
9
9
  return (_component$parents$fi = (_component$parents = component.parents) === null || _component$parents === void 0 || (_component$parents = _component$parents.find(function (parent) {
@@ -45,7 +45,7 @@ export var getMatchingComponents = function getMatchingComponents(_ref) {
45
45
  if (section.type !== 'menu-section' || isMenuFooterSectionKey(section.key) || !willComponentRender(section, childrenMap, surfaceContext)) {
46
46
  continue;
47
47
  }
48
- var _iterator3 = _createForOfIteratorHelper((_childrenMap$get = childrenMap.get(section.key)) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : []),
48
+ var _iterator3 = _createForOfIteratorHelper((_childrenMap$get = childrenMap.get(getComponentIdentity(section))) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : []),
49
49
  _step3;
50
50
  try {
51
51
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-type-ahead",
3
- "version": "17.0.0",
3
+ "version": "17.0.2",
4
4
  "description": "Type-ahead plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,14 +34,14 @@
34
34
  "@atlaskit/feature-gate-js-client": "^6.0.0",
35
35
  "@atlaskit/heading": "^7.1.0",
36
36
  "@atlaskit/icon": "^37.5.0",
37
- "@atlaskit/insm": "^2.0.0",
37
+ "@atlaskit/insm": "^3.0.0",
38
38
  "@atlaskit/menu": "^10.1.0",
39
39
  "@atlaskit/platform-feature-experiments": "^0.3.0",
40
40
  "@atlaskit/platform-feature-flags": "^2.1.0",
41
41
  "@atlaskit/primitives": "^22.4.0",
42
42
  "@atlaskit/prosemirror-history": "^1.2.0",
43
43
  "@atlaskit/prosemirror-input-rules": "^4.0.0",
44
- "@atlaskit/tmp-editor-statsig": "^160.0.0",
44
+ "@atlaskit/tmp-editor-statsig": "^161.0.0",
45
45
  "@atlaskit/tokens": "^16.8.0",
46
46
  "@atlaskit/visually-hidden": "^4.3.0",
47
47
  "@babel/runtime": "^7.0.0",
@@ -53,7 +53,7 @@
53
53
  "w3c-keyname": "^2.1.8"
54
54
  },
55
55
  "peerDependencies": {
56
- "@atlaskit/editor-common": "^120.0.0",
56
+ "@atlaskit/editor-common": "^120.1.0",
57
57
  "react": "^18.2.0 || ^19.2.0",
58
58
  "react-dom": "^18.2.0 || ^19.2.0",
59
59
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"