@atlaskit/editor-card-provider 4.2.1 → 4.2.3

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,22 @@
1
1
  # @atlaskit/editor-card-provider
2
2
 
3
+ ## 4.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#135566](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/135566)
8
+ [`610d0b7771536`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/610d0b7771536) -
9
+ Added support for base plan URL smart link
10
+
11
+ ## 4.2.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [#132126](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/132126)
16
+ [`5d45dce9796da`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5d45dce9796da) -
17
+ Updated dependency json-ld-types to @atlaskit/json-ld-types
18
+ - Updated dependencies
19
+
3
20
  ## 4.2.1
4
21
 
5
22
  ### Patch Changes
@@ -24,7 +24,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
24
24
  var api = _interopRequireWildcard(require("./api"));
25
25
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
26
26
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
27
- function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new BabelRegExp(e, void 0, r); }; var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { var o = RegExp(e, t); return r.set(o, p || r.get(e)), (0, _setPrototypeOf2.default)(o, BabelRegExp.prototype); } function buildGroups(e, t) { var p = r.get(t); return Object.keys(p).reduce(function (r, t) { var o = p[t]; if ("number" == typeof o) r[t] = e[o];else { for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; r[t] = e[o[i]]; } return r; }, Object.create(null)); } return (0, _inherits2.default)(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { var t = e.exec.call(this, r); if (t) { t.groups = buildGroups(t, this); var p = t.indices; p && (p.groups = buildGroups(p, this)); } return t; }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { if ("string" == typeof p) { var o = r.get(this); return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { var t = o[r]; return "$" + (Array.isArray(t) ? t.join("$") : t); })); } if ("function" == typeof p) { var i = this; return e[Symbol.replace].call(this, t, function () { var e = arguments; return "object" != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); }); } return e[Symbol.replace].call(this, t, p); }, _wrapRegExp.apply(this, arguments); }
27
+ function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new BabelRegExp(e, void 0, r); }; var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { var o = RegExp(e, t); return r.set(o, p || r.get(e)), (0, _setPrototypeOf2.default)(o, BabelRegExp.prototype); } function buildGroups(e, t) { var p = r.get(t); return Object.keys(p).reduce(function (r, t) { var o = p[t]; if ("number" == typeof o) r[t] = e[o];else { for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; r[t] = e[o[i]]; } return r; }, Object.create(null)); } return (0, _inherits2.default)(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { var t = e.exec.call(this, r); if (t) { t.groups = buildGroups(t, this); var p = t.indices; p && (p.groups = buildGroups(p, this)); } return t; }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { if ("string" == typeof p) { var o = r.get(this); return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)(>|$)/g, function (e, r, t) { if ("" === t) return e; var p = o[r]; return Array.isArray(p) ? "$" + p.join("$") : "number" == typeof p ? "$" + p : ""; })); } if ("function" == typeof p) { var i = this; return e[Symbol.replace].call(this, t, function () { var e = arguments; return "object" != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); }); } return e[Symbol.replace].call(this, t, p); }, _wrapRegExp.apply(this, arguments); }
28
28
  var BATCH_WAIT_TIME = 50;
29
29
 
30
30
  // Check if it is matching a Jira Roadmaps or Jira Timeline url
@@ -75,7 +75,9 @@ var isJiraBoard = function isJiraBoard(url) {
75
75
  return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\??.*/);
76
76
  };
77
77
  var isJiraPlan = function isJiraPlan(url) {
78
- return url.match( /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)\/scenarios\/(\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/, {
78
+ return url.match( /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)/, {
79
+ resourceId: 1
80
+ })) && (0, _platformFeatureFlags.fg)('plan_smart_link_base_url') || url.match( /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)\/scenarios\/(\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/, {
79
81
  resourceId: 1,
80
82
  resourceContext: 2
81
83
  }));
@@ -34,7 +34,7 @@ const isJiraBoard = url => {
34
34
  return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\??.*/);
35
35
  };
36
36
  const isJiraPlan = url => {
37
- return url.match(/https:\/\/.*?\/jira\/plans\/(?<resourceId>\d+)\/scenarios\/(?<resourceContext>\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/);
37
+ return url.match(/https:\/\/.*?\/jira\/plans\/(?<resourceId>\d+)/) && fg('plan_smart_link_base_url') || url.match(/https:\/\/.*?\/jira\/plans\/(?<resourceId>\d+)\/scenarios\/(?<resourceContext>\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/);
38
38
  };
39
39
  const isJiraVersion = url => {
40
40
  return url.match(/https:\/\/.*?\/projects\/[^\/]+?\/versions\/\d+\/tab\/release-report-all-issues/);
@@ -7,7 +7,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
7
  import _inherits from "@babel/runtime/helpers/inherits";
8
8
  import _setPrototypeOf from "@babel/runtime/helpers/setPrototypeOf";
9
9
  import _regeneratorRuntime from "@babel/runtime/regenerator";
10
- function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new BabelRegExp(e, void 0, r); }; var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { var o = RegExp(e, t); return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); } function buildGroups(e, t) { var p = r.get(t); return Object.keys(p).reduce(function (r, t) { var o = p[t]; if ("number" == typeof o) r[t] = e[o];else { for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; r[t] = e[o[i]]; } return r; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { var t = e.exec.call(this, r); if (t) { t.groups = buildGroups(t, this); var p = t.indices; p && (p.groups = buildGroups(p, this)); } return t; }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { if ("string" == typeof p) { var o = r.get(this); return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { var t = o[r]; return "$" + (Array.isArray(t) ? t.join("$") : t); })); } if ("function" == typeof p) { var i = this; return e[Symbol.replace].call(this, t, function () { var e = arguments; return "object" != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); }); } return e[Symbol.replace].call(this, t, p); }, _wrapRegExp.apply(this, arguments); }
10
+ function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new BabelRegExp(e, void 0, r); }; var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { var o = RegExp(e, t); return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); } function buildGroups(e, t) { var p = r.get(t); return Object.keys(p).reduce(function (r, t) { var o = p[t]; if ("number" == typeof o) r[t] = e[o];else { for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; r[t] = e[o[i]]; } return r; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { var t = e.exec.call(this, r); if (t) { t.groups = buildGroups(t, this); var p = t.indices; p && (p.groups = buildGroups(p, this)); } return t; }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { if ("string" == typeof p) { var o = r.get(this); return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)(>|$)/g, function (e, r, t) { if ("" === t) return e; var p = o[r]; return Array.isArray(p) ? "$" + p.join("$") : "number" == typeof p ? "$" + p : ""; })); } if ("function" == typeof p) { var i = this; return e[Symbol.replace].call(this, t, function () { var e = arguments; return "object" != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); }); } return e[Symbol.replace].call(this, t, p); }, _wrapRegExp.apply(this, arguments); }
11
11
  import { extractPreview } from '@atlaskit/link-extractors';
12
12
  import { getStatus } from '@atlaskit/linking-common';
13
13
  import DataLoader from 'dataloader';
@@ -67,7 +67,9 @@ var isJiraBoard = function isJiraBoard(url) {
67
67
  return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\??.*/);
68
68
  };
69
69
  var isJiraPlan = function isJiraPlan(url) {
70
- return url.match( /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)\/scenarios\/(\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/, {
70
+ return url.match( /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)/, {
71
+ resourceId: 1
72
+ })) && fg('plan_smart_link_base_url') || url.match( /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)\/scenarios\/(\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/, {
71
73
  resourceId: 1,
72
74
  resourceContext: 2
73
75
  }));
@@ -1,4 +1,4 @@
1
- import { type JsonLd } from 'json-ld-types';
1
+ import { type JsonLd } from '@atlaskit/json-ld-types';
2
2
  export declare class NetworkError extends Error {
3
3
  constructor(error: any);
4
4
  }
@@ -1,4 +1,4 @@
1
- import { type JsonLd } from 'json-ld-types';
1
+ import { type JsonLd } from '@atlaskit/json-ld-types';
2
2
  export declare class NetworkError extends Error {
3
3
  constructor(error: any);
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-card-provider",
3
- "version": "4.2.1",
3
+ "version": "4.2.3",
4
4
  "description": "Contains the EditorCardProvider, for determining smart card behaviour in the editor.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,13 +35,13 @@
35
35
  "dependencies": {
36
36
  "@atlaskit/eslint-plugin-platform": "^2.5.0",
37
37
  "@atlaskit/feature-gate-js-client": "^5.0.0",
38
+ "@atlaskit/json-ld-types": "^1.0.0",
38
39
  "@atlaskit/link-client-extension": "^4.0.0",
39
40
  "@atlaskit/link-extractors": "^2.0.0",
40
41
  "@atlaskit/linking-common": "^8.0.0",
41
42
  "@atlaskit/platform-feature-flags": "^1.1.0",
42
43
  "@babel/runtime": "^7.0.0",
43
- "dataloader": "^2.1.0",
44
- "json-ld-types": "^4.1.0"
44
+ "dataloader": "^2.1.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@atlaskit/link-provider": "^2.0.0",
@@ -59,6 +59,9 @@
59
59
  },
60
60
  "tc_smart_link_embed_view": {
61
61
  "type": "boolean"
62
+ },
63
+ "plan_smart_link_base_url": {
64
+ "type": "boolean"
62
65
  }
63
66
  }
64
67
  }