@atlaskit/editor-jira-transformer 8.1.18 → 8.1.22

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,30 @@
1
1
  # @atlaskit/editor-jira-transformer
2
2
 
3
+ ## 8.1.22
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 8.1.21
10
+
11
+ ### Patch Changes
12
+
13
+ - [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - ED-13753 Updated editor-common import entries.
14
+ - Updated dependencies
15
+
16
+ ## 8.1.20
17
+
18
+ ### Patch Changes
19
+
20
+ - [`d2ff410796a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d2ff410796a) - Fix jira-transformer
21
+
22
+ ## 8.1.19
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies
27
+
3
28
  ## 8.1.18
4
29
 
5
30
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -122,57 +122,68 @@ var JIRATransformer = /*#__PURE__*/function () {
122
122
  mediaGroup = _this$schema$nodes.mediaGroup,
123
123
  mediaSingle = _this$schema$nodes.mediaSingle,
124
124
  media = _this$schema$nodes.media,
125
- table = _this$schema$nodes.table;
125
+ table = _this$schema$nodes.table; // We compare node type names in this method rather than
126
+ // node types directly as the node comparision fails.
127
+ // This suggests the schema which is coming from
128
+ // the doc has been recreated after being passed
129
+ // to this transformer on setup which is somewhat
130
+ // unexpected.
131
+ // This package is internally (within editor) considered
132
+ // "obsolete", and we are aiming to either hand over
133
+ // or deprecate.
134
+ // This "fix" is being done to unblock an existing
135
+ // consumer so they can apply an unrelated security
136
+ // upgrade.
126
137
 
127
138
  if (node.isText) {
128
139
  return this.encodeText(node);
129
- } else if (node.type === heading) {
140
+ } else if (node.type.name === heading.name) {
130
141
  return this.encodeHeading(node);
131
- } else if (node.type === rule) {
142
+ } else if (node.type.name === rule.name) {
132
143
  return this.encodeHorizontalRule();
133
- } else if (node.type === paragraph) {
144
+ } else if (node.type.name === paragraph.name) {
134
145
  return this.encodeParagraph(node);
135
- } else if (node.type === hardBreak) {
146
+ } else if (node.type.name === hardBreak.name) {
136
147
  return this.encodeHardBreak();
137
148
  }
138
149
 
139
150
  if ((0, _adfSchema.isSchemaWithLists)(this.schema)) {
140
- if (node.type === bulletList) {
151
+ if (node.type.name === bulletList.name) {
141
152
  return this.encodeBulletList(node);
142
- } else if (node.type === orderedList) {
153
+ } else if (node.type.name === orderedList.name) {
143
154
  return this.encodeOrderedList(node);
144
- } else if (node.type === listItem) {
155
+ } else if (node.type.name === listItem.name) {
145
156
  return this.encodeListItem(node);
146
157
  }
147
158
  }
148
159
 
149
- if ((0, _adfSchema.isSchemaWithMentions)(this.schema) && node.type === mention) {
160
+ if ((0, _adfSchema.isSchemaWithMentions)(this.schema) && node.type.name === mention.name) {
150
161
  return this.encodeMention(node, this.customEncoders.mention);
151
162
  }
152
163
 
153
- if ((0, _adfSchema.isSchemaWithEmojis)(this.schema) && node.type === emoji) {
164
+ if ((0, _adfSchema.isSchemaWithEmojis)(this.schema) && node.type.name === emoji.name) {
154
165
  return this.encodeEmoji(node);
155
166
  }
156
167
 
157
- if ((0, _adfSchema.isSchemaWithCodeBlock)(this.schema) && node.type === codeBlock) {
168
+ if ((0, _adfSchema.isSchemaWithCodeBlock)(this.schema) && node.type.name === codeBlock.name) {
158
169
  return this.encodeCodeBlock(node);
159
170
  }
160
171
 
161
- if ((0, _adfSchema.isSchemaWithBlockQuotes)(this.schema) && node.type === blockquote) {
172
+ if ((0, _adfSchema.isSchemaWithBlockQuotes)(this.schema) && node.type.name === blockquote.name) {
162
173
  return this.encodeBlockQuote(node);
163
174
  }
164
175
 
165
176
  if ((0, _adfSchema.isSchemaWithMedia)(this.schema)) {
166
- if (node.type === mediaGroup) {
177
+ if (node.type.name === mediaGroup.name) {
167
178
  return this.encodeMediaGroup(node);
168
- } else if (node.type === mediaSingle) {
179
+ } else if (node.type.name === mediaSingle.name) {
169
180
  return this.encodeMediaSingle(node);
170
- } else if (node.type === media) {
181
+ } else if (node.type.name === media.name) {
171
182
  return this.encodeMedia(node);
172
183
  }
173
184
  }
174
185
 
175
- if ((0, _adfSchema.isSchemaWithTables)(this.schema) && node.type === table) {
186
+ if ((0, _adfSchema.isSchemaWithTables)(this.schema) && node.type.name === table.name) {
176
187
  return this.encodeTable(node);
177
188
  }
178
189
 
@@ -3,64 +3,64 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "isSchemaWithLists", {
6
+ Object.defineProperty(exports, "isSchemaWithAdvancedTextFormattingMarks", {
7
7
  enumerable: true,
8
8
  get: function get() {
9
- return _adfSchema.isSchemaWithLists;
9
+ return _adfSchema.isSchemaWithAdvancedTextFormattingMarks;
10
10
  }
11
11
  });
12
- Object.defineProperty(exports, "isSchemaWithMentions", {
12
+ Object.defineProperty(exports, "isSchemaWithBlockQuotes", {
13
13
  enumerable: true,
14
14
  get: function get() {
15
- return _adfSchema.isSchemaWithMentions;
15
+ return _adfSchema.isSchemaWithBlockQuotes;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "isSchemaWithLinks", {
18
+ Object.defineProperty(exports, "isSchemaWithCodeBlock", {
19
19
  enumerable: true,
20
20
  get: function get() {
21
- return _adfSchema.isSchemaWithLinks;
21
+ return _adfSchema.isSchemaWithCodeBlock;
22
22
  }
23
23
  });
24
- Object.defineProperty(exports, "isSchemaWithAdvancedTextFormattingMarks", {
24
+ Object.defineProperty(exports, "isSchemaWithLinks", {
25
25
  enumerable: true,
26
26
  get: function get() {
27
- return _adfSchema.isSchemaWithAdvancedTextFormattingMarks;
27
+ return _adfSchema.isSchemaWithLinks;
28
28
  }
29
29
  });
30
- Object.defineProperty(exports, "isSchemaWithSubSupMark", {
30
+ Object.defineProperty(exports, "isSchemaWithLists", {
31
31
  enumerable: true,
32
32
  get: function get() {
33
- return _adfSchema.isSchemaWithSubSupMark;
33
+ return _adfSchema.isSchemaWithLists;
34
34
  }
35
35
  });
36
- Object.defineProperty(exports, "isSchemaWithCodeBlock", {
36
+ Object.defineProperty(exports, "isSchemaWithMedia", {
37
37
  enumerable: true,
38
38
  get: function get() {
39
- return _adfSchema.isSchemaWithCodeBlock;
39
+ return _adfSchema.isSchemaWithMedia;
40
40
  }
41
41
  });
42
- Object.defineProperty(exports, "isSchemaWithBlockQuotes", {
42
+ Object.defineProperty(exports, "isSchemaWithMentions", {
43
43
  enumerable: true,
44
44
  get: function get() {
45
- return _adfSchema.isSchemaWithBlockQuotes;
45
+ return _adfSchema.isSchemaWithMentions;
46
46
  }
47
47
  });
48
- Object.defineProperty(exports, "isSchemaWithMedia", {
48
+ Object.defineProperty(exports, "isSchemaWithSubSupMark", {
49
49
  enumerable: true,
50
50
  get: function get() {
51
- return _adfSchema.isSchemaWithMedia;
51
+ return _adfSchema.isSchemaWithSubSupMark;
52
52
  }
53
53
  });
54
- Object.defineProperty(exports, "isSchemaWithTextColor", {
54
+ Object.defineProperty(exports, "isSchemaWithTables", {
55
55
  enumerable: true,
56
56
  get: function get() {
57
- return _adfSchema.isSchemaWithTextColor;
57
+ return _adfSchema.isSchemaWithTables;
58
58
  }
59
59
  });
60
- Object.defineProperty(exports, "isSchemaWithTables", {
60
+ Object.defineProperty(exports, "isSchemaWithTextColor", {
61
61
  enumerable: true,
62
62
  get: function get() {
63
- return _adfSchema.isSchemaWithTables;
63
+ return _adfSchema.isSchemaWithTextColor;
64
64
  }
65
65
  });
66
66
 
package/dist/cjs/utils.js CHANGED
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ensureBlocks = ensureBlocks;
7
- exports.convert = convert;
8
6
  exports.bfsOrder = bfsOrder;
7
+ exports.convert = convert;
8
+ exports.ensureBlocks = ensureBlocks;
9
9
  exports.ensureInline = void 0;
10
10
 
11
11
  var _adfSchema = require("@atlaskit/adf-schema");
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-jira-transformer",
3
- "version": "8.1.18",
3
+ "version": "8.1.22",
4
4
  "sideEffects": false
5
5
  }
@@ -90,57 +90,68 @@ export class JIRATransformer {
90
90
  mediaSingle,
91
91
  media,
92
92
  table
93
- } = this.schema.nodes;
93
+ } = this.schema.nodes; // We compare node type names in this method rather than
94
+ // node types directly as the node comparision fails.
95
+ // This suggests the schema which is coming from
96
+ // the doc has been recreated after being passed
97
+ // to this transformer on setup which is somewhat
98
+ // unexpected.
99
+ // This package is internally (within editor) considered
100
+ // "obsolete", and we are aiming to either hand over
101
+ // or deprecate.
102
+ // This "fix" is being done to unblock an existing
103
+ // consumer so they can apply an unrelated security
104
+ // upgrade.
94
105
 
95
106
  if (node.isText) {
96
107
  return this.encodeText(node);
97
- } else if (node.type === heading) {
108
+ } else if (node.type.name === heading.name) {
98
109
  return this.encodeHeading(node);
99
- } else if (node.type === rule) {
110
+ } else if (node.type.name === rule.name) {
100
111
  return this.encodeHorizontalRule();
101
- } else if (node.type === paragraph) {
112
+ } else if (node.type.name === paragraph.name) {
102
113
  return this.encodeParagraph(node);
103
- } else if (node.type === hardBreak) {
114
+ } else if (node.type.name === hardBreak.name) {
104
115
  return this.encodeHardBreak();
105
116
  }
106
117
 
107
118
  if (isSchemaWithLists(this.schema)) {
108
- if (node.type === bulletList) {
119
+ if (node.type.name === bulletList.name) {
109
120
  return this.encodeBulletList(node);
110
- } else if (node.type === orderedList) {
121
+ } else if (node.type.name === orderedList.name) {
111
122
  return this.encodeOrderedList(node);
112
- } else if (node.type === listItem) {
123
+ } else if (node.type.name === listItem.name) {
113
124
  return this.encodeListItem(node);
114
125
  }
115
126
  }
116
127
 
117
- if (isSchemaWithMentions(this.schema) && node.type === mention) {
128
+ if (isSchemaWithMentions(this.schema) && node.type.name === mention.name) {
118
129
  return this.encodeMention(node, this.customEncoders.mention);
119
130
  }
120
131
 
121
- if (isSchemaWithEmojis(this.schema) && node.type === emoji) {
132
+ if (isSchemaWithEmojis(this.schema) && node.type.name === emoji.name) {
122
133
  return this.encodeEmoji(node);
123
134
  }
124
135
 
125
- if (isSchemaWithCodeBlock(this.schema) && node.type === codeBlock) {
136
+ if (isSchemaWithCodeBlock(this.schema) && node.type.name === codeBlock.name) {
126
137
  return this.encodeCodeBlock(node);
127
138
  }
128
139
 
129
- if (isSchemaWithBlockQuotes(this.schema) && node.type === blockquote) {
140
+ if (isSchemaWithBlockQuotes(this.schema) && node.type.name === blockquote.name) {
130
141
  return this.encodeBlockQuote(node);
131
142
  }
132
143
 
133
144
  if (isSchemaWithMedia(this.schema)) {
134
- if (node.type === mediaGroup) {
145
+ if (node.type.name === mediaGroup.name) {
135
146
  return this.encodeMediaGroup(node);
136
- } else if (node.type === mediaSingle) {
147
+ } else if (node.type.name === mediaSingle.name) {
137
148
  return this.encodeMediaSingle(node);
138
- } else if (node.type === media) {
149
+ } else if (node.type.name === media.name) {
139
150
  return this.encodeMedia(node);
140
151
  }
141
152
  }
142
153
 
143
- if (isSchemaWithTables(this.schema) && node.type === table) {
154
+ if (isSchemaWithTables(this.schema) && node.type.name === table.name) {
144
155
  return this.encodeTable(node);
145
156
  }
146
157
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-jira-transformer",
3
- "version": "8.1.18",
3
+ "version": "8.1.22",
4
4
  "sideEffects": false
5
5
  }
package/dist/esm/index.js CHANGED
@@ -107,57 +107,68 @@ export var JIRATransformer = /*#__PURE__*/function () {
107
107
  mediaGroup = _this$schema$nodes.mediaGroup,
108
108
  mediaSingle = _this$schema$nodes.mediaSingle,
109
109
  media = _this$schema$nodes.media,
110
- table = _this$schema$nodes.table;
110
+ table = _this$schema$nodes.table; // We compare node type names in this method rather than
111
+ // node types directly as the node comparision fails.
112
+ // This suggests the schema which is coming from
113
+ // the doc has been recreated after being passed
114
+ // to this transformer on setup which is somewhat
115
+ // unexpected.
116
+ // This package is internally (within editor) considered
117
+ // "obsolete", and we are aiming to either hand over
118
+ // or deprecate.
119
+ // This "fix" is being done to unblock an existing
120
+ // consumer so they can apply an unrelated security
121
+ // upgrade.
111
122
 
112
123
  if (node.isText) {
113
124
  return this.encodeText(node);
114
- } else if (node.type === heading) {
125
+ } else if (node.type.name === heading.name) {
115
126
  return this.encodeHeading(node);
116
- } else if (node.type === rule) {
127
+ } else if (node.type.name === rule.name) {
117
128
  return this.encodeHorizontalRule();
118
- } else if (node.type === paragraph) {
129
+ } else if (node.type.name === paragraph.name) {
119
130
  return this.encodeParagraph(node);
120
- } else if (node.type === hardBreak) {
131
+ } else if (node.type.name === hardBreak.name) {
121
132
  return this.encodeHardBreak();
122
133
  }
123
134
 
124
135
  if (isSchemaWithLists(this.schema)) {
125
- if (node.type === bulletList) {
136
+ if (node.type.name === bulletList.name) {
126
137
  return this.encodeBulletList(node);
127
- } else if (node.type === orderedList) {
138
+ } else if (node.type.name === orderedList.name) {
128
139
  return this.encodeOrderedList(node);
129
- } else if (node.type === listItem) {
140
+ } else if (node.type.name === listItem.name) {
130
141
  return this.encodeListItem(node);
131
142
  }
132
143
  }
133
144
 
134
- if (isSchemaWithMentions(this.schema) && node.type === mention) {
145
+ if (isSchemaWithMentions(this.schema) && node.type.name === mention.name) {
135
146
  return this.encodeMention(node, this.customEncoders.mention);
136
147
  }
137
148
 
138
- if (isSchemaWithEmojis(this.schema) && node.type === emoji) {
149
+ if (isSchemaWithEmojis(this.schema) && node.type.name === emoji.name) {
139
150
  return this.encodeEmoji(node);
140
151
  }
141
152
 
142
- if (isSchemaWithCodeBlock(this.schema) && node.type === codeBlock) {
153
+ if (isSchemaWithCodeBlock(this.schema) && node.type.name === codeBlock.name) {
143
154
  return this.encodeCodeBlock(node);
144
155
  }
145
156
 
146
- if (isSchemaWithBlockQuotes(this.schema) && node.type === blockquote) {
157
+ if (isSchemaWithBlockQuotes(this.schema) && node.type.name === blockquote.name) {
147
158
  return this.encodeBlockQuote(node);
148
159
  }
149
160
 
150
161
  if (isSchemaWithMedia(this.schema)) {
151
- if (node.type === mediaGroup) {
162
+ if (node.type.name === mediaGroup.name) {
152
163
  return this.encodeMediaGroup(node);
153
- } else if (node.type === mediaSingle) {
164
+ } else if (node.type.name === mediaSingle.name) {
154
165
  return this.encodeMediaSingle(node);
155
- } else if (node.type === media) {
166
+ } else if (node.type.name === media.name) {
156
167
  return this.encodeMedia(node);
157
168
  }
158
169
  }
159
170
 
160
- if (isSchemaWithTables(this.schema) && node.type === table) {
171
+ if (isSchemaWithTables(this.schema) && node.type.name === table.name) {
161
172
  return this.encodeTable(node);
162
173
  }
163
174
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-jira-transformer",
3
- "version": "8.1.18",
3
+ "version": "8.1.22",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { Node as PMNode, Schema } from 'prosemirror-model';
2
- import { Transformer } from '@atlaskit/editor-common';
2
+ import { Transformer } from '@atlaskit/editor-common/types';
3
3
  export declare type CustomEncoder = (userId: string) => string;
4
4
  export interface JIRACustomEncoders {
5
5
  mention?: CustomEncoder;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-jira-transformer",
3
- "version": "8.1.18",
3
+ "version": "8.1.22",
4
4
  "description": "Editor JIRA transformer's",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -24,8 +24,8 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@atlaskit/adf-schema": "^20.0.0",
28
- "@atlaskit/editor-common": "^61.0.0",
27
+ "@atlaskit/adf-schema": "^22.0.0",
28
+ "@atlaskit/editor-common": "^64.0.0",
29
29
  "@babel/runtime": "^7.0.0",
30
30
  "collapse-whitespace": "^1.1.6",
31
31
  "prosemirror-model": "1.14.3"
@@ -36,11 +36,11 @@
36
36
  "devDependencies": {
37
37
  "@atlaskit/activity": "^1.0.1",
38
38
  "@atlaskit/docs": "*",
39
- "@atlaskit/editor-core": "^152.0.0",
39
+ "@atlaskit/editor-core": "^155.0.0",
40
40
  "@atlaskit/editor-json-transformer": "^8.7.0",
41
- "@atlaskit/editor-test-helpers": "^15.6.0",
42
- "@atlaskit/theme": "^12.0.0",
43
- "@atlaskit/util-data-test": "^17.0.0",
41
+ "@atlaskit/editor-test-helpers": "^16.1.0",
42
+ "@atlaskit/theme": "^12.1.0",
43
+ "@atlaskit/util-data-test": "^17.2.0",
44
44
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
45
45
  "@types/prosemirror-model": "^1.11.0",
46
46
  "styled-components": "^3.2.6",