@atlaskit/editor-card-provider 3.1.8 → 3.1.9

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/editor-card-provider
2
2
 
3
+ ## 3.1.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#40406](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40406) [`542d0dd0b1d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/542d0dd0b1d) - [ux] Changed default smart card view for Confluence Databases route from inline to embed.
8
+
3
9
  ## 3.1.8
4
10
 
5
11
  ### Patch Changes
@@ -51,6 +51,9 @@ var isConfluenceWhiteboard = function isConfluenceWhiteboard(url) {
51
51
  resourceId: 1
52
52
  }));
53
53
  };
54
+ var isConfluenceDatabase = function isConfluenceDatabase(url) {
55
+ return url.match(/\/wiki\/spaces\/~?[\d\w]+\/database\/\d+$/);
56
+ };
54
57
  var EditorCardProvider = /*#__PURE__*/function () {
55
58
  function EditorCardProvider(envKey, baseUrlOverride) {
56
59
  var _this = this;
@@ -320,7 +323,7 @@ var EditorCardProvider = /*#__PURE__*/function () {
320
323
  }, {
321
324
  key: "getHardCodedAppearance",
322
325
  value: function getHardCodedAppearance(url) {
323
- if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url)) {
326
+ if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url)) {
324
327
  return 'embed';
325
328
  }
326
329
  }
@@ -18,6 +18,7 @@ const isJwmView = url => url.match(/^https:\/\/.*?\/jira\/core\/projects\/[^\/]+
18
18
  const isGiphyMedia = url => url.match(/^https:\/\/(.*?\.)?giphy\.com\/(gifs|media|clips)\//);
19
19
  const isProformaView = url => url.match(/^https:\/\/[^/]+\/jira\/(core|software(\/c)?|servicedesk)\/projects\/\w+\/forms\/form\/direct\/\d+\/\d+.*$/);
20
20
  const isConfluenceWhiteboard = url => url.match(/\/wiki\/spaces\/?.*\/whiteboard\/(?<resourceId>\d+)(\?\/)?/) || url.match(/\/wiki\/spaces\/?.*\/whiteboard\/(?<resourceId>[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12})(\?\/)?/);
21
+ const isConfluenceDatabase = url => url.match(/\/wiki\/spaces\/~?[\d\w]+\/database\/\d+$/);
21
22
  export class EditorCardProvider {
22
23
  constructor(envKey, baseUrlOverride) {
23
24
  this.baseUrl = baseUrlOverride || getBaseUrl(envKey);
@@ -109,7 +110,7 @@ export class EditorCardProvider {
109
110
  return (_this$providersData2 = this.providersData) === null || _this$providersData2 === void 0 ? void 0 : _this$providersData2.patterns.find(pattern => url.match(pattern.source));
110
111
  }
111
112
  getHardCodedAppearance(url) {
112
- if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url)) {
113
+ if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url)) {
113
114
  return 'embed';
114
115
  }
115
116
  }
@@ -43,6 +43,9 @@ var isConfluenceWhiteboard = function isConfluenceWhiteboard(url) {
43
43
  resourceId: 1
44
44
  }));
45
45
  };
46
+ var isConfluenceDatabase = function isConfluenceDatabase(url) {
47
+ return url.match(/\/wiki\/spaces\/~?[\d\w]+\/database\/\d+$/);
48
+ };
46
49
  export var EditorCardProvider = /*#__PURE__*/function () {
47
50
  function EditorCardProvider(envKey, baseUrlOverride) {
48
51
  var _this = this;
@@ -312,7 +315,7 @@ export var EditorCardProvider = /*#__PURE__*/function () {
312
315
  }, {
313
316
  key: "getHardCodedAppearance",
314
317
  value: function getHardCodedAppearance(url) {
315
- if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url)) {
318
+ if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url)) {
316
319
  return 'embed';
317
320
  }
318
321
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-card-provider",
3
- "version": "3.1.8",
3
+ "version": "3.1.9",
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",