@atlaskit/adf-schema 35.9.2 → 35.11.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,17 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 35.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b7684a5: [COMMENTS-1380] Moving the localId on mentions to full schema because it was accidentally promoted to full schema already due to a erroneously placed stage 0 tag
8
+
9
+ ## 35.10.0
10
+
11
+ ### Minor Changes
12
+
13
+ - b9f54d8: add localId attribute to mention node
14
+
3
15
  ## 35.9.2
4
16
 
5
17
  ### Patch Changes
@@ -33,6 +33,9 @@ var mention = exports.mention = {
33
33
  },
34
34
  userType: {
35
35
  default: null
36
+ },
37
+ localId: {
38
+ default: null
36
39
  }
37
40
  },
38
41
  parseDOM: [{
@@ -42,7 +45,8 @@ var mention = exports.mention = {
42
45
  var attrs = {
43
46
  id: dom.getAttribute('data-mention-id') || mention.attrs.id.default,
44
47
  text: dom.textContent || mention.attrs.text.default,
45
- accessLevel: dom.getAttribute('data-access-level') || mention.attrs.accessLevel.default
48
+ accessLevel: dom.getAttribute('data-access-level') || mention.attrs.accessLevel.default,
49
+ localId: dom.getAttribute('data-local-id') || mention.attrs.localId.default
46
50
  };
47
51
  var userType = dom.getAttribute('data-user-type');
48
52
  if (USER_TYPES[userType]) {
@@ -56,12 +60,16 @@ var mention = exports.mention = {
56
60
  id = _node$attrs.id,
57
61
  accessLevel = _node$attrs.accessLevel,
58
62
  text = _node$attrs.text,
59
- userType = _node$attrs.userType;
63
+ userType = _node$attrs.userType,
64
+ localId = _node$attrs.localId;
60
65
  var attrs = {
61
66
  'data-mention-id': id,
62
67
  'data-access-level': accessLevel,
63
68
  contenteditable: 'false'
64
69
  };
70
+ if (localId) {
71
+ attrs['data-local-id'] = localId;
72
+ }
65
73
  if (userType) {
66
74
  attrs['data-user-type'] = userType;
67
75
  }
@@ -25,6 +25,9 @@ export const mention = {
25
25
  },
26
26
  userType: {
27
27
  default: null
28
+ },
29
+ localId: {
30
+ default: null
28
31
  }
29
32
  },
30
33
  parseDOM: [{
@@ -34,7 +37,8 @@ export const mention = {
34
37
  const attrs = {
35
38
  id: dom.getAttribute('data-mention-id') || mention.attrs.id.default,
36
39
  text: dom.textContent || mention.attrs.text.default,
37
- accessLevel: dom.getAttribute('data-access-level') || mention.attrs.accessLevel.default
40
+ accessLevel: dom.getAttribute('data-access-level') || mention.attrs.accessLevel.default,
41
+ localId: dom.getAttribute('data-local-id') || mention.attrs.localId.default
38
42
  };
39
43
  const userType = dom.getAttribute('data-user-type');
40
44
  if (USER_TYPES[userType]) {
@@ -48,13 +52,17 @@ export const mention = {
48
52
  id,
49
53
  accessLevel,
50
54
  text,
51
- userType
55
+ userType,
56
+ localId
52
57
  } = node.attrs;
53
58
  const attrs = {
54
59
  'data-mention-id': id,
55
60
  'data-access-level': accessLevel,
56
61
  contenteditable: 'false'
57
62
  };
63
+ if (localId) {
64
+ attrs['data-local-id'] = localId;
65
+ }
58
66
  if (userType) {
59
67
  attrs['data-user-type'] = userType;
60
68
  }
@@ -28,6 +28,9 @@ export var mention = {
28
28
  },
29
29
  userType: {
30
30
  default: null
31
+ },
32
+ localId: {
33
+ default: null
31
34
  }
32
35
  },
33
36
  parseDOM: [{
@@ -37,7 +40,8 @@ export var mention = {
37
40
  var attrs = {
38
41
  id: dom.getAttribute('data-mention-id') || mention.attrs.id.default,
39
42
  text: dom.textContent || mention.attrs.text.default,
40
- 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
41
45
  };
42
46
  var userType = dom.getAttribute('data-user-type');
43
47
  if (USER_TYPES[userType]) {
@@ -51,12 +55,16 @@ export var mention = {
51
55
  id = _node$attrs.id,
52
56
  accessLevel = _node$attrs.accessLevel,
53
57
  text = _node$attrs.text,
54
- userType = _node$attrs.userType;
58
+ userType = _node$attrs.userType,
59
+ localId = _node$attrs.localId;
55
60
  var attrs = {
56
61
  'data-mention-id': id,
57
62
  'data-access-level': accessLevel,
58
63
  contenteditable: 'false'
59
64
  };
65
+ if (localId) {
66
+ attrs['data-local-id'] = localId;
67
+ }
60
68
  if (userType) {
61
69
  attrs['data-user-type'] = userType;
62
70
  }
@@ -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.11.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.9.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",