@atlaskit/editor-plugin-mentions 1.2.0 → 1.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-plugin-mentions
2
2
 
3
+ ## 1.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#101524](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/101524)
8
+ [`4821570088e6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4821570088e6) -
9
+ ED-23362 Bump ADF schema to version 36.8.1 and add support for adf validation and transformation
10
+
3
11
  ## 1.2.0
4
12
 
5
13
  ### Minor Changes
@@ -22,7 +22,8 @@ var MentionAssistiveTextComponent = function MentionAssistiveTextComponent(_ref)
22
22
  text = _ref.text,
23
23
  providers = _ref.providers,
24
24
  accessLevel = _ref.accessLevel,
25
- mentionProvider = _ref.mentionProvider;
25
+ mentionProvider = _ref.mentionProvider,
26
+ localId = _ref.localId;
26
27
  var _useState = (0, _react.useState)(text),
27
28
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
28
29
  resolvedName = _useState2[0],
@@ -82,7 +83,8 @@ var MentionAssistiveTextComponent = function MentionAssistiveTextComponent(_ref)
82
83
  id: id,
83
84
  text: resolvedName,
84
85
  accessLevel: accessLevel,
85
- providers: providers
86
+ providers: providers,
87
+ localId: localId
86
88
  })));
87
89
  };
88
90
  var MentionNodeView = exports.MentionNodeView = function MentionNodeView(props) {
@@ -90,7 +92,8 @@ var MentionNodeView = exports.MentionNodeView = function MentionNodeView(props)
90
92
  var _props$node$attrs = props.node.attrs,
91
93
  id = _props$node$attrs.id,
92
94
  text = _props$node$attrs.text,
93
- accessLevel = _props$node$attrs.accessLevel;
95
+ accessLevel = _props$node$attrs.accessLevel,
96
+ localId = _props$node$attrs.localId;
94
97
  var renderAssistiveTextWithProviders = function renderAssistiveTextWithProviders(providers) {
95
98
  var _ref3 = providers,
96
99
  mentionProvider = _ref3.mentionProvider;
@@ -99,7 +102,8 @@ var MentionNodeView = exports.MentionNodeView = function MentionNodeView(props)
99
102
  id: id,
100
103
  text: text,
101
104
  providers: providerFactory,
102
- accessLevel: accessLevel
105
+ accessLevel: accessLevel,
106
+ localId: localId
103
107
  });
104
108
  };
105
109
  return /*#__PURE__*/_react.default.createElement(_providerFactory.WithProviders, {
@@ -178,7 +178,8 @@ var buildNodesForTeamMention = function buildNodesForTeamMention(schema, selecte
178
178
  text: text,
179
179
  id: member.id,
180
180
  accessLevel: accessLevel,
181
- userType: 'DEFAULT'
181
+ userType: 'DEFAULT',
182
+ localId: (0, _uuid.default)()
182
183
  });
183
184
  inlineNodes.push(userMentionNode);
184
185
  // should not add empty space after the last user mention.
@@ -332,7 +333,8 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
332
333
  text: text,
333
334
  id: id,
334
335
  accessLevel: accessLevel,
335
- userType: userType === 'DEFAULT' ? null : userType
336
+ userType: userType === 'DEFAULT' ? null : userType,
337
+ localId: (0, _uuid.default)()
336
338
  });
337
339
  var space = schema.text(' ');
338
340
  return insert(_model.Fragment.from([mentionNode, space]));
@@ -46,7 +46,8 @@ var Mention = exports.default = /*#__PURE__*/function (_PureComponent) {
46
46
  accessLevel = _this$props.accessLevel,
47
47
  eventHandlers = _this$props.eventHandlers,
48
48
  id = _this$props.id,
49
- text = _this$props.text;
49
+ text = _this$props.text,
50
+ localId = _this$props.localId;
50
51
  var _ref = providers,
51
52
  mentionProvider = _ref.mentionProvider;
52
53
  var actionHandlers = {};
@@ -57,6 +58,7 @@ var Mention = exports.default = /*#__PURE__*/function (_PureComponent) {
57
58
  id: id,
58
59
  text: text,
59
60
  accessLevel: accessLevel,
61
+ localId: localId,
60
62
  mentionProvider: mentionProvider
61
63
  }, actionHandlers));
62
64
  });
@@ -9,7 +9,8 @@ const MentionAssistiveTextComponent = ({
9
9
  text,
10
10
  providers,
11
11
  accessLevel,
12
- mentionProvider
12
+ mentionProvider,
13
+ localId
13
14
  }) => {
14
15
  const [resolvedName, setResolvedName] = useState(text);
15
16
  const processName = name => {
@@ -41,7 +42,8 @@ const MentionAssistiveTextComponent = ({
41
42
  id: id,
42
43
  text: resolvedName,
43
44
  accessLevel: accessLevel,
44
- providers: providers
45
+ providers: providers,
46
+ localId: localId
45
47
  })));
46
48
  };
47
49
  export const MentionNodeView = props => {
@@ -51,7 +53,8 @@ export const MentionNodeView = props => {
51
53
  const {
52
54
  id,
53
55
  text,
54
- accessLevel
56
+ accessLevel,
57
+ localId
55
58
  } = props.node.attrs;
56
59
  const renderAssistiveTextWithProviders = providers => {
57
60
  const {
@@ -62,7 +65,8 @@ export const MentionNodeView = props => {
62
65
  id: id,
63
66
  text: text,
64
67
  providers: providerFactory,
65
- accessLevel: accessLevel
68
+ accessLevel: accessLevel,
69
+ localId: localId
66
70
  });
67
71
  };
68
72
  return /*#__PURE__*/React.createElement(WithProviders, {
@@ -154,7 +154,8 @@ const buildNodesForTeamMention = (schema, selectedMention, mentionProvider, sani
154
154
  text,
155
155
  id: member.id,
156
156
  accessLevel,
157
- userType: 'DEFAULT'
157
+ userType: 'DEFAULT',
158
+ localId: uuid()
158
159
  });
159
160
  inlineNodes.push(userMentionNode);
160
161
  // should not add empty space after the last user mention.
@@ -316,7 +317,8 @@ export const createTypeAheadConfig = ({
316
317
  text,
317
318
  id,
318
319
  accessLevel,
319
- userType: userType === 'DEFAULT' ? null : userType
320
+ userType: userType === 'DEFAULT' ? null : userType,
321
+ localId: uuid()
320
322
  });
321
323
  const space = schema.text(' ');
322
324
  return insert(Fragment.from([mentionNode, space]));
@@ -25,7 +25,8 @@ export default class Mention extends PureComponent {
25
25
  accessLevel,
26
26
  eventHandlers,
27
27
  id,
28
- text
28
+ text,
29
+ localId
29
30
  } = this.props;
30
31
  const {
31
32
  mentionProvider
@@ -38,6 +39,7 @@ export default class Mention extends PureComponent {
38
39
  id: id,
39
40
  text: text,
40
41
  accessLevel: accessLevel,
42
+ localId: localId,
41
43
  mentionProvider: mentionProvider
42
44
  }, actionHandlers));
43
45
  });
@@ -12,7 +12,8 @@ var MentionAssistiveTextComponent = function MentionAssistiveTextComponent(_ref)
12
12
  text = _ref.text,
13
13
  providers = _ref.providers,
14
14
  accessLevel = _ref.accessLevel,
15
- mentionProvider = _ref.mentionProvider;
15
+ mentionProvider = _ref.mentionProvider,
16
+ localId = _ref.localId;
16
17
  var _useState = useState(text),
17
18
  _useState2 = _slicedToArray(_useState, 2),
18
19
  resolvedName = _useState2[0],
@@ -72,7 +73,8 @@ var MentionAssistiveTextComponent = function MentionAssistiveTextComponent(_ref)
72
73
  id: id,
73
74
  text: resolvedName,
74
75
  accessLevel: accessLevel,
75
- providers: providers
76
+ providers: providers,
77
+ localId: localId
76
78
  })));
77
79
  };
78
80
  export var MentionNodeView = function MentionNodeView(props) {
@@ -80,7 +82,8 @@ export var MentionNodeView = function MentionNodeView(props) {
80
82
  var _props$node$attrs = props.node.attrs,
81
83
  id = _props$node$attrs.id,
82
84
  text = _props$node$attrs.text,
83
- accessLevel = _props$node$attrs.accessLevel;
85
+ accessLevel = _props$node$attrs.accessLevel,
86
+ localId = _props$node$attrs.localId;
84
87
  var renderAssistiveTextWithProviders = function renderAssistiveTextWithProviders(providers) {
85
88
  var _ref3 = providers,
86
89
  mentionProvider = _ref3.mentionProvider;
@@ -89,7 +92,8 @@ export var MentionNodeView = function MentionNodeView(props) {
89
92
  id: id,
90
93
  text: text,
91
94
  providers: providerFactory,
92
- accessLevel: accessLevel
95
+ accessLevel: accessLevel,
96
+ localId: localId
93
97
  });
94
98
  };
95
99
  return /*#__PURE__*/React.createElement(WithProviders, {
@@ -166,7 +166,8 @@ var buildNodesForTeamMention = function buildNodesForTeamMention(schema, selecte
166
166
  text: text,
167
167
  id: member.id,
168
168
  accessLevel: accessLevel,
169
- userType: 'DEFAULT'
169
+ userType: 'DEFAULT',
170
+ localId: uuid()
170
171
  });
171
172
  inlineNodes.push(userMentionNode);
172
173
  // should not add empty space after the last user mention.
@@ -320,7 +321,8 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref6) {
320
321
  text: text,
321
322
  id: id,
322
323
  accessLevel: accessLevel,
323
- userType: userType === 'DEFAULT' ? null : userType
324
+ userType: userType === 'DEFAULT' ? null : userType,
325
+ localId: uuid()
324
326
  });
325
327
  var space = schema.text(' ');
326
328
  return insert(Fragment.from([mentionNode, space]));
@@ -37,7 +37,8 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
37
37
  accessLevel = _this$props.accessLevel,
38
38
  eventHandlers = _this$props.eventHandlers,
39
39
  id = _this$props.id,
40
- text = _this$props.text;
40
+ text = _this$props.text,
41
+ localId = _this$props.localId;
41
42
  var _ref = providers,
42
43
  mentionProvider = _ref.mentionProvider;
43
44
  var actionHandlers = {};
@@ -48,6 +49,7 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
48
49
  id: id,
49
50
  text: text,
50
51
  accessLevel: accessLevel,
52
+ localId: localId,
51
53
  mentionProvider: mentionProvider
52
54
  }, actionHandlers));
53
55
  });
@@ -1,4 +1,5 @@
1
+ import type { GasPayload } from '@atlaskit/analytics-gas-types';
1
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
3
  import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
3
4
  import type { MentionPluginOptions, MentionPluginState } from '../types';
4
- export declare function createMentionPlugin(pmPluginFactoryParams: PMPluginFactoryParams, fireEvent: (payload: any) => void, options?: MentionPluginOptions): SafePlugin<MentionPluginState>;
5
+ export declare function createMentionPlugin(pmPluginFactoryParams: PMPluginFactoryParams, fireEvent: (payload: GasPayload) => void, options?: MentionPluginOptions): SafePlugin<MentionPluginState>;
@@ -7,6 +7,7 @@ export interface MentionProps {
7
7
  eventHandlers?: MentionEventHandlers;
8
8
  text: string;
9
9
  accessLevel?: string;
10
+ localId?: string;
10
11
  }
11
12
  export default class Mention extends PureComponent<MentionProps, {}> {
12
13
  static displayName: string;
@@ -1,4 +1,5 @@
1
+ import type { GasPayload } from '@atlaskit/analytics-gas-types';
1
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
3
  import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
3
4
  import type { MentionPluginOptions, MentionPluginState } from '../types';
4
- export declare function createMentionPlugin(pmPluginFactoryParams: PMPluginFactoryParams, fireEvent: (payload: any) => void, options?: MentionPluginOptions): SafePlugin<MentionPluginState>;
5
+ export declare function createMentionPlugin(pmPluginFactoryParams: PMPluginFactoryParams, fireEvent: (payload: GasPayload) => void, options?: MentionPluginOptions): SafePlugin<MentionPluginState>;
@@ -7,6 +7,7 @@ export interface MentionProps {
7
7
  eventHandlers?: MentionEventHandlers;
8
8
  text: string;
9
9
  accessLevel?: string;
10
+ localId?: string;
10
11
  }
11
12
  export default class Mention extends PureComponent<MentionProps, {}> {
12
13
  static displayName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-mentions",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Mentions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,9 +33,9 @@
33
33
  ".": "./src/index.ts"
34
34
  },
35
35
  "dependencies": {
36
- "@atlaskit/adf-schema": "^36.3.0",
36
+ "@atlaskit/adf-schema": "^36.8.0",
37
37
  "@atlaskit/analytics-gas-types": "^5.1.0",
38
- "@atlaskit/editor-common": "^80.1.0",
38
+ "@atlaskit/editor-common": "^80.4.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^1.2.0",
40
40
  "@atlaskit/editor-plugin-context-identifier": "^1.1.0",
41
41
  "@atlaskit/editor-plugin-type-ahead": "^1.2.0",