@atlaskit/adf-schema 35.9.2 → 35.10.0

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,11 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 35.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b9f54d8: add localId attribute to mention node
8
+
3
9
  ## 35.9.2
4
10
 
5
11
  ### Patch Changes
@@ -33,6 +33,12 @@ var mention = exports.mention = {
33
33
  },
34
34
  userType: {
35
35
  default: null
36
+ },
37
+ /**
38
+ * @stage 0
39
+ */
40
+ localId: {
41
+ default: null
36
42
  }
37
43
  },
38
44
  parseDOM: [{
@@ -42,7 +48,8 @@ var mention = exports.mention = {
42
48
  var attrs = {
43
49
  id: dom.getAttribute('data-mention-id') || mention.attrs.id.default,
44
50
  text: dom.textContent || mention.attrs.text.default,
45
- accessLevel: dom.getAttribute('data-access-level') || mention.attrs.accessLevel.default
51
+ accessLevel: dom.getAttribute('data-access-level') || mention.attrs.accessLevel.default,
52
+ localId: dom.getAttribute('data-local-id') || mention.attrs.localId.default
46
53
  };
47
54
  var userType = dom.getAttribute('data-user-type');
48
55
  if (USER_TYPES[userType]) {
@@ -56,12 +63,16 @@ var mention = exports.mention = {
56
63
  id = _node$attrs.id,
57
64
  accessLevel = _node$attrs.accessLevel,
58
65
  text = _node$attrs.text,
59
- userType = _node$attrs.userType;
66
+ userType = _node$attrs.userType,
67
+ localId = _node$attrs.localId;
60
68
  var attrs = {
61
69
  'data-mention-id': id,
62
70
  'data-access-level': accessLevel,
63
71
  contenteditable: 'false'
64
72
  };
73
+ if (localId) {
74
+ attrs['data-local-id'] = localId;
75
+ }
65
76
  if (userType) {
66
77
  attrs['data-user-type'] = userType;
67
78
  }
@@ -25,6 +25,12 @@ export const mention = {
25
25
  },
26
26
  userType: {
27
27
  default: null
28
+ },
29
+ /**
30
+ * @stage 0
31
+ */
32
+ localId: {
33
+ default: null
28
34
  }
29
35
  },
30
36
  parseDOM: [{
@@ -34,7 +40,8 @@ export const mention = {
34
40
  const attrs = {
35
41
  id: dom.getAttribute('data-mention-id') || mention.attrs.id.default,
36
42
  text: dom.textContent || mention.attrs.text.default,
37
- accessLevel: dom.getAttribute('data-access-level') || mention.attrs.accessLevel.default
43
+ accessLevel: dom.getAttribute('data-access-level') || mention.attrs.accessLevel.default,
44
+ localId: dom.getAttribute('data-local-id') || mention.attrs.localId.default
38
45
  };
39
46
  const userType = dom.getAttribute('data-user-type');
40
47
  if (USER_TYPES[userType]) {
@@ -48,13 +55,17 @@ export const mention = {
48
55
  id,
49
56
  accessLevel,
50
57
  text,
51
- userType
58
+ userType,
59
+ localId
52
60
  } = node.attrs;
53
61
  const attrs = {
54
62
  'data-mention-id': id,
55
63
  'data-access-level': accessLevel,
56
64
  contenteditable: 'false'
57
65
  };
66
+ if (localId) {
67
+ attrs['data-local-id'] = localId;
68
+ }
58
69
  if (userType) {
59
70
  attrs['data-user-type'] = userType;
60
71
  }
@@ -28,6 +28,12 @@ export var mention = {
28
28
  },
29
29
  userType: {
30
30
  default: null
31
+ },
32
+ /**
33
+ * @stage 0
34
+ */
35
+ localId: {
36
+ default: null
31
37
  }
32
38
  },
33
39
  parseDOM: [{
@@ -37,7 +43,8 @@ export var mention = {
37
43
  var attrs = {
38
44
  id: dom.getAttribute('data-mention-id') || mention.attrs.id.default,
39
45
  text: dom.textContent || mention.attrs.text.default,
40
- accessLevel: dom.getAttribute('data-access-level') || mention.attrs.accessLevel.default
46
+ accessLevel: dom.getAttribute('data-access-level') || mention.attrs.accessLevel.default,
47
+ localId: dom.getAttribute('data-local-id') || mention.attrs.localId.default
41
48
  };
42
49
  var userType = dom.getAttribute('data-user-type');
43
50
  if (USER_TYPES[userType]) {
@@ -51,12 +58,16 @@ export var mention = {
51
58
  id = _node$attrs.id,
52
59
  accessLevel = _node$attrs.accessLevel,
53
60
  text = _node$attrs.text,
54
- userType = _node$attrs.userType;
61
+ userType = _node$attrs.userType,
62
+ localId = _node$attrs.localId;
55
63
  var attrs = {
56
64
  'data-mention-id': id,
57
65
  'data-access-level': accessLevel,
58
66
  contenteditable: 'false'
59
67
  };
68
+ if (localId) {
69
+ attrs['data-local-id'] = localId;
70
+ }
60
71
  if (userType) {
61
72
  attrs['data-user-type'] = userType;
62
73
  }
@@ -543,6 +543,9 @@
543
543
  },
544
544
  "accessLevel": {
545
545
  "type": "string"
546
+ },
547
+ "localId": {
548
+ "type": "string"
546
549
  }
547
550
  },
548
551
  "required": [
@@ -543,6 +543,9 @@
543
543
  },
544
544
  "accessLevel": {
545
545
  "type": "string"
546
+ },
547
+ "localId": {
548
+ "type": "string"
546
549
  }
547
550
  },
548
551
  "required": [
@@ -10,6 +10,7 @@ export interface MentionAttributes {
10
10
  text?: string;
11
11
  userType?: UserType;
12
12
  accessLevel?: string;
13
+ localId?: string;
13
14
  }
14
15
  /**
15
16
  * @name mention_node
@@ -543,6 +543,9 @@
543
543
  },
544
544
  "accessLevel": {
545
545
  "type": "string"
546
+ },
547
+ "localId": {
548
+ "type": "string"
546
549
  }
547
550
  },
548
551
  "required": [
@@ -543,6 +543,9 @@
543
543
  },
544
544
  "accessLevel": {
545
545
  "type": "string"
546
+ },
547
+ "localId": {
548
+ "type": "string"
546
549
  }
547
550
  },
548
551
  "required": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "35.9.2",
3
+ "version": "35.10.0",
4
4
  "description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -41,7 +41,7 @@
41
41
  "memoize-one": "^6.0.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@atlassian/adf-schema-json": "^1.7.0",
44
+ "@atlassian/adf-schema-json": "^1.8.0",
45
45
  "@babel/cli": "^7.22.9",
46
46
  "@babel/core": "^7.22.9",
47
47
  "@babel/plugin-proposal-class-properties": "^7.18.6",