@atlaskit/editor-jira-transformer 20.0.1 → 20.1.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,24 @@
1
1
  # @atlaskit/editor-jira-transformer
2
2
 
3
+ ## 20.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`51c33ef5349b6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/51c33ef5349b6) -
8
+ Enable compatibility with React 19.2.0
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 20.0.2
15
+
16
+ ### Patch Changes
17
+
18
+ - [`24d7483e9519e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/24d7483e9519e) -
19
+ Cleans up prefer static regex violations
20
+ - Updated dependencies
21
+
3
22
  ## 20.0.1
4
23
 
5
24
  ### Patch Changes
package/compass.yml ADDED
@@ -0,0 +1,41 @@
1
+ configVersion: 1
2
+ id: ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:component/c5751cc6-3513-4070-9deb-af31e86aed34/f5aa6196-5da5-44dd-8bcb-69119736cbf0
3
+ name: '@atlaskit/editor-jira-transformer'
4
+ ownerId: ari:cloud:identity::team/f3f77d87-a3bb-439d-a3a5-c7d481ec4e3b # Eng - Create - Native Content Types - Collab (Michael Kimpton)
5
+ labels:
6
+ - platform-code
7
+ - platform-afm
8
+ typeId: OTHER
9
+ fields:
10
+ tier: 4
11
+ lifecycle: Active
12
+ isMonorepoProject: true
13
+ links:
14
+ - name: Root Repository
15
+ type: REPOSITORY
16
+ url: https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master
17
+ - name: Slack Channel
18
+ type: CHAT_CHANNEL
19
+ url: https://atlassian.enterprise.slack.com/archives/C02GEULKMLN # #team-cc-editor-services
20
+ - name: Editor Jira Transformer
21
+ type: REPOSITORY
22
+ url: https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master/platform/packages/editor/editor-jira-transformer
23
+ customFields:
24
+ - name: Department
25
+ type: text
26
+ value: Eng - Editor Collaboration Platform
27
+ - name: Trusted Reviewer Teams
28
+ type: text
29
+ value: ari:cloud:identity::team/cf6a670b-5252-4c68-a769-9207de366beb
30
+ - name: Technical Owner
31
+ type: user
32
+ value: ari:cloud:identity::user/712020:d2fbbbd7-fd7c-4d3a-9f0a-7a97b6b26e40 # Michael Kimpton
33
+ - name: Required Reviewers Opt In
34
+ type: boolean
35
+ value: true
36
+ - name: Reviewer Selection Mechanism
37
+ type: text
38
+ value: random(2)
39
+ - name: Required Reviewer Approvals
40
+ type: number
41
+ value: 1
package/dist/cjs/index.js CHANGED
@@ -15,6 +15,9 @@ var _schemaJira = require("@atlaskit/adf-schema/schema-jira");
15
15
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
16
16
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
17
17
  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; }
18
+ // Ignored via go/ees005
19
+ // eslint-disable-next-line require-unicode-regexp
20
+ var FRAGMENT_HREF_REGEX = /^#/;
18
21
  var JIRATransformer = exports.JIRATransformer = /*#__PURE__*/function () {
19
22
  function JIRATransformer(schema, customEncoders, mediaContextInfo) {
20
23
  (0, _classCallCheck2.default)(this, JIRATransformer);
@@ -290,9 +293,7 @@ var JIRATransformer = exports.JIRATransformer = /*#__PURE__*/function () {
290
293
  var href = mark.attrs['href'];
291
294
 
292
295
  /** JIRA always expects external-link attribute set on links created via editor unless its #fragment */
293
- // Ignored via go/ees005
294
- // eslint-disable-next-line require-unicode-regexp
295
- if (!href.match(/^#/)) {
296
+ if (!href.match(FRAGMENT_HREF_REGEX)) {
296
297
  linkElem.setAttribute('class', 'external-link');
297
298
  linkElem.setAttribute('rel', 'nofollow');
298
299
  }
package/dist/cjs/utils.js CHANGED
@@ -14,6 +14,10 @@ var _emojiHelper = require("./emojiHelper");
14
14
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
15
15
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
16
16
  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; }
17
+ // Ignored via go/ees005
18
+ // eslint-disable-next-line require-unicode-regexp
19
+ var WHITESPACE_ONLY_REGEX = /^\s*$/;
20
+
17
21
  /**
18
22
  * Ensure that each node in the fragment is a block, wrapping
19
23
  * in a block node if necessary.
@@ -234,9 +238,7 @@ function convert(content, node, schema) {
234
238
  if (child.type === schema.nodes.media) {
235
239
  mediaArray.push(child);
236
240
  return;
237
- // Ignored via go/ees005
238
- // eslint-disable-next-line require-unicode-regexp
239
- } else if (!(child.isText && /^\s*$/.test(child.text || ''))) {
241
+ } else if (!(child.isText && WHITESPACE_ONLY_REGEX.test(child.text || ''))) {
240
242
  hasNonMediaChildren = true;
241
243
  }
242
244
  contentArray.push(child);
@@ -3,6 +3,9 @@ import parseHtml from './parse-html';
3
3
  import fixDoc from './fix-doc';
4
4
  import { bfsOrder, convert, ensureBlocks } from './utils';
5
5
  import { isSchemaWithLists, isSchemaWithMentions, isSchemaWithEmojis, isSchemaWithCodeBlock, isSchemaWithBlockQuotes, isSchemaWithMedia, isSchemaWithTables } from '@atlaskit/adf-schema/schema-jira';
6
+ // Ignored via go/ees005
7
+ // eslint-disable-next-line require-unicode-regexp
8
+ const FRAGMENT_HREF_REGEX = /^#/;
6
9
  export class JIRATransformer {
7
10
  constructor(schema, customEncoders, mediaContextInfo) {
8
11
  this.schema = schema;
@@ -254,9 +257,7 @@ export class JIRATransformer {
254
257
  const href = mark.attrs['href'];
255
258
 
256
259
  /** JIRA always expects external-link attribute set on links created via editor unless its #fragment */
257
- // Ignored via go/ees005
258
- // eslint-disable-next-line require-unicode-regexp
259
- if (!href.match(/^#/)) {
260
+ if (!href.match(FRAGMENT_HREF_REGEX)) {
260
261
  linkElem.setAttribute('class', 'external-link');
261
262
  linkElem.setAttribute('rel', 'nofollow');
262
263
  }
@@ -3,6 +3,10 @@ import { isSchemaWithLists, isSchemaWithMentions, isSchemaWithLinks, isSchemaWit
3
3
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
4
4
  import { mapImageToEmoji } from './emojiHelper';
5
5
 
6
+ // Ignored via go/ees005
7
+ // eslint-disable-next-line require-unicode-regexp
8
+ const WHITESPACE_ONLY_REGEX = /^\s*$/;
9
+
6
10
  /**
7
11
  * Ensure that each node in the fragment is a block, wrapping
8
12
  * in a block node if necessary.
@@ -220,9 +224,7 @@ export function convert(content, node, schema) {
220
224
  if (child.type === schema.nodes.media) {
221
225
  mediaArray.push(child);
222
226
  return;
223
- // Ignored via go/ees005
224
- // eslint-disable-next-line require-unicode-regexp
225
- } else if (!(child.isText && /^\s*$/.test(child.text || ''))) {
227
+ } else if (!(child.isText && WHITESPACE_ONLY_REGEX.test(child.text || ''))) {
226
228
  hasNonMediaChildren = true;
227
229
  }
228
230
  contentArray.push(child);
package/dist/esm/index.js CHANGED
@@ -8,6 +8,9 @@ import parseHtml from './parse-html';
8
8
  import fixDoc from './fix-doc';
9
9
  import { bfsOrder, convert, ensureBlocks } from './utils';
10
10
  import { isSchemaWithLists, isSchemaWithMentions, isSchemaWithEmojis, isSchemaWithCodeBlock, isSchemaWithBlockQuotes, isSchemaWithMedia, isSchemaWithTables } from '@atlaskit/adf-schema/schema-jira';
11
+ // Ignored via go/ees005
12
+ // eslint-disable-next-line require-unicode-regexp
13
+ var FRAGMENT_HREF_REGEX = /^#/;
11
14
  export var JIRATransformer = /*#__PURE__*/function () {
12
15
  function JIRATransformer(schema, customEncoders, mediaContextInfo) {
13
16
  _classCallCheck(this, JIRATransformer);
@@ -283,9 +286,7 @@ export var JIRATransformer = /*#__PURE__*/function () {
283
286
  var href = mark.attrs['href'];
284
287
 
285
288
  /** JIRA always expects external-link attribute set on links created via editor unless its #fragment */
286
- // Ignored via go/ees005
287
- // eslint-disable-next-line require-unicode-regexp
288
- if (!href.match(/^#/)) {
289
+ if (!href.match(FRAGMENT_HREF_REGEX)) {
289
290
  linkElem.setAttribute('class', 'external-link');
290
291
  linkElem.setAttribute('rel', 'nofollow');
291
292
  }
package/dist/esm/utils.js CHANGED
@@ -6,6 +6,10 @@ import { isSchemaWithLists, isSchemaWithMentions, isSchemaWithLinks, isSchemaWit
6
6
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
7
7
  import { mapImageToEmoji } from './emojiHelper';
8
8
 
9
+ // Ignored via go/ees005
10
+ // eslint-disable-next-line require-unicode-regexp
11
+ var WHITESPACE_ONLY_REGEX = /^\s*$/;
12
+
9
13
  /**
10
14
  * Ensure that each node in the fragment is a block, wrapping
11
15
  * in a block node if necessary.
@@ -226,9 +230,7 @@ export function convert(content, node, schema) {
226
230
  if (child.type === schema.nodes.media) {
227
231
  mediaArray.push(child);
228
232
  return;
229
- // Ignored via go/ees005
230
- // eslint-disable-next-line require-unicode-regexp
231
- } else if (!(child.isText && /^\s*$/.test(child.text || ''))) {
233
+ } else if (!(child.isText && WHITESPACE_ONLY_REGEX.test(child.text || ''))) {
232
234
  hasNonMediaChildren = true;
233
235
  }
234
236
  contentArray.push(child);
@@ -14,13 +14,13 @@ const packagePath = path.resolve(__dirname);
14
14
  const documentation: StructuredContentSource = {
15
15
  components: [
16
16
  {
17
- name: 'Editor Jira Transformer',
17
+ name: 'JIRATransformer',
18
18
  description: "Editor JIRA transformer's",
19
19
  status: 'general-availability',
20
20
  import: {
21
- name: 'Editor Jira Transformer',
21
+ name: 'JIRATransformer',
22
22
  package: '@atlaskit/editor-jira-transformer',
23
- type: 'default',
23
+ type: 'named',
24
24
  packagePath,
25
25
  packageJson,
26
26
  },
@@ -30,11 +30,6 @@ const documentation: StructuredContentSource = {
30
30
  keywords: ['editor', 'editor-jira-transformer', 'atlaskit'],
31
31
  categories: ['editor'],
32
32
  examples: [
33
- {
34
- name: 'Jira transformer',
35
- description: 'Basic Jira transformer usage.',
36
- source: path.resolve(packagePath, './examples/0-jira-transformer.tsx'),
37
- },
38
33
  {
39
34
  name: 'Jira HTML to ADF',
40
35
  description: 'Transform Jira HTML to ADF.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-jira-transformer",
3
- "version": "20.0.1",
3
+ "version": "20.1.0",
4
4
  "description": "Editor JIRA transformer's",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -21,27 +21,27 @@
21
21
  }
22
22
  },
23
23
  "dependencies": {
24
- "@atlaskit/adf-schema": "^56.0.0",
24
+ "@atlaskit/adf-schema": "^56.2.0",
25
25
  "@atlaskit/editor-prosemirror": "^8.0.0",
26
26
  "@babel/runtime": "^7.0.0",
27
27
  "collapse-whitespace": "^1.1.6"
28
28
  },
29
29
  "peerDependencies": {
30
- "@atlaskit/editor-common": "^116.4.0",
31
- "react": "^18.2.0"
30
+ "@atlaskit/editor-common": "^116.45.0",
31
+ "react": "^18.2.0 || ^19.2.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@atlaskit/activity": "^1.0.1",
35
- "@atlaskit/editor-core": "^221.1.0",
36
- "@atlaskit/editor-json-transformer": "^9.0.0",
35
+ "@atlaskit/editor-core": "^221.16.0",
36
+ "@atlaskit/editor-json-transformer": "^9.2.0",
37
37
  "@atlaskit/editor-test-helpers": "workspace:^",
38
- "@atlaskit/mention": "^27.1.0",
39
- "@atlaskit/theme": "^26.0.0",
40
- "@atlaskit/tokens": "^14.0.0",
41
- "@atlaskit/util-data-test": "^19.0.0",
38
+ "@atlaskit/mention": "^27.12.0",
39
+ "@atlaskit/theme": "^26.1.0",
40
+ "@atlaskit/tokens": "^16.3.0",
41
+ "@atlaskit/util-data-test": "^19.1.0",
42
42
  "@atlassian/structured-docs-types": "workspace:^",
43
43
  "@emotion/react": "^11.7.1",
44
- "react": "^18.2.0"
44
+ "react": "^19.2.0"
45
45
  },
46
46
  "techstack": {
47
47
  "@repo/internal": {