@atlaskit/editor-card-provider 7.0.5 → 7.0.7

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,19 @@
1
1
  # @atlaskit/editor-card-provider
2
2
 
3
+ ## 7.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 7.0.6
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8e5e159447746`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8e5e159447746) -
14
+ Clean up prefer static regex violations
15
+ - Updated dependencies
16
+
3
17
  ## 7.0.5
4
18
 
5
19
  ### Patch Changes
@@ -38,114 +38,133 @@ function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new B
38
38
  var BATCH_WAIT_TIME = 50;
39
39
  // Check if it is matching a Jira Roadmaps or Jira Timeline url
40
40
  // NOT to be confused with JSM timeline
41
+ var JIRA_ROADMAP_OR_TIMELINE_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/(timeline|roadmap)\/?/;
42
+ var POLARIS_VIEW_REGEX = /^https:\/\/.*?\/jira\/polaris\/projects\/[^\/]+?\/ideas\/view\/\d+$|^https:\/\/.*?\/secure\/JiraProductDiscoveryAnonymous\.jspa\?hash=\w+|^https:\/\/.*?\/jira\/polaris\/share\/\w+|^https:\/\/.*?\/jira\/discovery\/share\/views\/[\w-]+(\?selectedIssue=[\w-]+&issueViewLayout=sidebar&issueViewSection=[\w-]+)?$/;
43
+ var JWM_VIEW_REGEX = /^https:\/\/.*?\/jira\/core\/projects\/[^\/]+?\/(timeline|calendar|list|board|summary|(form\/[^\/]+?))\/?/;
44
+ var JIRA_LIST_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/list\/?/;
45
+ var GIPHY_MEDIA_REGEX = /^https:\/\/(.*?\.)?giphy\.com\/(gifs|media|clips)\//;
46
+ var PROFORMA_VIEW_REGEX = /^https:\/\/[^/]+\/jira\/(core|software(\/c)?|servicedesk)\/projects\/\w+\/forms\/form\/direct\/\d+\/\d+.*$/;
47
+ // prettier-ignore
48
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
49
+ var CONFLUENCE_WHITEBOARD_DECIMAL_REGEX = /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/?.*\/whiteboard\/(\d+)(\?\/)?/, {
50
+ resourceId: 1
51
+ });
52
+ // prettier-ignore
53
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
54
+ var CONFLUENCE_WHITEBOARD_UUID_REGEX = /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/?.*\/whiteboard\/([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})(\?\/)?/, {
55
+ resourceId: 1
56
+ });
57
+ var CONFLUENCE_DATABASE_REGEX = /\/wiki\/spaces\/~?[\d\w]+\/database\/\d+(\?.*)?$/;
58
+ var YOUTUBE_VIDEO_REGEX = /^https:\/\/(.*?\.)?(youtube\..*?\/(watch\?|v\/|shorts\/)|youtu\.be)/;
59
+ // prettier-ignore
60
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
61
+ var LOOM_VIDEO_URL_REGEX = /*#__PURE__*/_wrapRegExp(/^https:\/\/(.*?\.)?(loom\..*?\/(share|embed))\/([a-zA-Z0-9-]*-)?([a-f0-9]{32})/, {
62
+ videoId: 5
63
+ });
64
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
65
+ var LOOM_SCREENSHOT_URL_REGEX = /*#__PURE__*/_wrapRegExp(/^https:\/\/(.*?\.)?loom\..*?\/i\/([a-f0-9]{32})/, {
66
+ id: 2
67
+ });
68
+ var JIRA_DASHBOARD_REGEX = /^https:\/\/.*?\/jira\/dashboards\/[0-9]+.*/;
69
+ var JIRA_BACKLOG_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\/backlog\??.*/;
70
+ var JIRA_BOARD_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\??.*/;
71
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
72
+ var JIRA_PLAN_REGEX = /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)/, {
73
+ resourceId: 1
74
+ });
75
+ // prettier-ignore
76
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
77
+ var JIRA_PLAN_WITH_SCENARIO_REGEX = /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)\/scenarios\/(\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/, {
78
+ resourceId: 1,
79
+ resourceContext: 2
80
+ });
81
+ var JIRA_VERSION_REGEX = /https:\/\/.*?\/projects\/[^\/]+?\/versions\/\d+\/tab\/release-report-all-issues/;
82
+ var JIRA_FORM_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/form\/\d\??.*/;
83
+ var JIRA_SUMMARY_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/summary/;
84
+ var ROVO_AGENT_PROFILE_PAGE_REGEX = /^https:\/\/.*?\/people\/agent\/.+$/;
85
+ var CUSTOMER_360_LANDING_PAGE_REGEX = /^https:\/\/customer\.atlassian\.com\/.*$/;
86
+ // prettier-ignore
87
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
88
+ var CONFLUENCE_TEAM_CALENDARS_REGEX = /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/([^\/]+)\/calendars\/([a-zA-Z0-9-]+)/, {
89
+ resourceContext: 1,
90
+ resourceId: 2
91
+ });
92
+ var JIRA_ISSUE_NAVIGATOR_REGEX = /^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/;
93
+ var AVP_VISUALIZATION_VIEW_REGEX = /^https:\/\/.*?\/avpviz\/c\/[^\/]+.*/;
94
+ var JIRA_WORK_ITEM_REGEX = /\/browse\/((?:\w+)-(?:\d+))/i;
95
+ var DOES_URL_MATCH_PATH_START_REGEX = /^[a-zA-Z0-9]/;
96
+ var DOES_URL_MATCH_PATH_END_REGEX = /[a-zA-Z0-9]$/;
41
97
  var isJiraRoadmapOrTimeline = function isJiraRoadmapOrTimeline(url) {
42
- return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/(timeline|roadmap)\/?/);
98
+ return url.match(JIRA_ROADMAP_OR_TIMELINE_REGEX);
43
99
  };
44
100
  var isPolarisView = function isPolarisView(url) {
45
- return url.match(/^https:\/\/.*?\/jira\/polaris\/projects\/[^\/]+?\/ideas\/view\/\d+$|^https:\/\/.*?\/secure\/JiraProductDiscoveryAnonymous\.jspa\?hash=\w+|^https:\/\/.*?\/jira\/polaris\/share\/\w+|^https:\/\/.*?\/jira\/discovery\/share\/views\/[\w-]+(\?selectedIssue=[\w-]+&issueViewLayout=sidebar&issueViewSection=[\w-]+)?$/);
101
+ return url.match(POLARIS_VIEW_REGEX);
46
102
  };
47
103
  var isJwmView = function isJwmView(url) {
48
- return url.match(/^https:\/\/.*?\/jira\/core\/projects\/[^\/]+?\/(timeline|calendar|list|board|summary|(form\/[^\/]+?))\/?/);
104
+ return url.match(JWM_VIEW_REGEX);
49
105
  };
50
106
  var isJiraList = function isJiraList(url) {
51
- return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/list\/?/);
107
+ return url.match(JIRA_LIST_REGEX);
52
108
  };
53
109
  var isGiphyMedia = function isGiphyMedia(url) {
54
- return url.match(/^https:\/\/(.*?\.)?giphy\.com\/(gifs|media|clips)\//);
110
+ return url.match(GIPHY_MEDIA_REGEX);
55
111
  };
56
112
  var isProformaView = function isProformaView(url) {
57
- return url.match(/^https:\/\/[^/]+\/jira\/(core|software(\/c)?|servicedesk)\/projects\/\w+\/forms\/form\/direct\/\d+\/\d+.*$/);
113
+ return url.match(PROFORMA_VIEW_REGEX);
58
114
  };
59
115
  var isConfluenceWhiteboard = function isConfluenceWhiteboard(url) {
60
- return (
61
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
62
- url.match( /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/?.*\/whiteboard\/(\d+)(\?\/)?/, {
63
- resourceId: 1
64
- })) || url.match(
65
- /*#__PURE__*/
66
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
67
- _wrapRegExp(/\/wiki\/spaces\/?.*\/whiteboard\/([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})(\?\/)?/, {
68
- resourceId: 1
69
- }))
70
- );
116
+ return url.match(CONFLUENCE_WHITEBOARD_DECIMAL_REGEX) || url.match(CONFLUENCE_WHITEBOARD_UUID_REGEX);
71
117
  };
72
118
  var isConfluenceDatabase = function isConfluenceDatabase(url) {
73
- return url.match(/\/wiki\/spaces\/~?[\d\w]+\/database\/\d+(\?.*)?$/);
119
+ return url.match(CONFLUENCE_DATABASE_REGEX);
74
120
  };
75
121
  var isYoutubeVideo = function isYoutubeVideo(url) {
76
- return url.match(/^https:\/\/(.*?\.)?(youtube\..*?\/(watch\?|v\/|shorts\/)|youtu\.be)/);
122
+ return url.match(YOUTUBE_VIDEO_REGEX);
77
123
  };
78
124
  var isLoomVideoUrl = function isLoomVideoUrl(url) {
79
- return url.match(
80
- /*#__PURE__*/
81
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
82
- _wrapRegExp(/^https:\/\/(.*?\.)?(loom\..*?\/(share|embed))\/([a-zA-Z0-9-]*-)?([a-f0-9]{32})/, {
83
- videoId: 5
84
- }));
125
+ return url.match(LOOM_VIDEO_URL_REGEX);
85
126
  };
86
127
  var isLoomScreenshotUrl = function isLoomScreenshotUrl(url) {
87
- return url.match(
88
- /*#__PURE__*/
89
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
90
- _wrapRegExp(/^https:\/\/(.*?\.)?loom\..*?\/i\/([a-f0-9]{32})/, {
91
- id: 2
92
- }));
128
+ return url.match(LOOM_SCREENSHOT_URL_REGEX);
93
129
  };
94
130
  var isJiraDashboard = function isJiraDashboard(url) {
95
- return url.match(/^https:\/\/.*?\/jira\/dashboards\/[0-9]+.*/);
131
+ return url.match(JIRA_DASHBOARD_REGEX);
96
132
  };
97
133
  var isJiraBacklog = function isJiraBacklog(url) {
98
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\/backlog\??.*/);
134
+ return url.match(JIRA_BACKLOG_REGEX);
99
135
  };
100
136
  var isJiraBoard = function isJiraBoard(url) {
101
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\??.*/);
137
+ return url.match(JIRA_BOARD_REGEX);
102
138
  };
103
139
  var isJiraPlan = function isJiraPlan(url) {
104
- return (
105
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
106
- url.match( /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)/, {
107
- resourceId: 1
108
- })) || url.match(
109
- /*#__PURE__*/
110
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
111
- _wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)\/scenarios\/(\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/, {
112
- resourceId: 1,
113
- resourceContext: 2
114
- }))
115
- );
140
+ return url.match(JIRA_PLAN_REGEX) || url.match(JIRA_PLAN_WITH_SCENARIO_REGEX);
116
141
  };
117
142
  var isJiraVersion = function isJiraVersion(url) {
118
- return url.match(/https:\/\/.*?\/projects\/[^\/]+?\/versions\/\d+\/tab\/release-report-all-issues/);
143
+ return url.match(JIRA_VERSION_REGEX);
119
144
  };
120
145
  var isJiraForm = function isJiraForm(url) {
121
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/form\/\d\??.*/);
146
+ return url.match(JIRA_FORM_REGEX);
122
147
  };
123
148
  var isJiraSummary = function isJiraSummary(url) {
124
- return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/summary/);
149
+ return url.match(JIRA_SUMMARY_REGEX);
125
150
  };
126
151
  var isRovoAgentProfilePage = function isRovoAgentProfilePage(url) {
127
- return url.match(/^https:\/\/.*?\/people\/agent\/.+$/);
152
+ return url.match(ROVO_AGENT_PROFILE_PAGE_REGEX);
128
153
  };
129
154
  var isCustomer360LandingPage = function isCustomer360LandingPage(url) {
130
- return url.match(/^https:\/\/customer\.atlassian\.com\/.*$/);
155
+ return url.match(CUSTOMER_360_LANDING_PAGE_REGEX);
131
156
  };
132
157
  var isConfluenceTeamCalendars = function isConfluenceTeamCalendars(url) {
133
- return (
134
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
135
- url.match( /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/([^\/]+)\/calendars\/([a-zA-Z0-9-]+)/, {
136
- resourceContext: 1,
137
- resourceId: 2
138
- }))
139
- );
158
+ return url.match(CONFLUENCE_TEAM_CALENDARS_REGEX);
140
159
  };
141
160
  var isJiraIssueNavigator = function isJiraIssueNavigator(url) {
142
- return url.match(/^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/);
161
+ return url.match(JIRA_ISSUE_NAVIGATOR_REGEX);
143
162
  };
144
163
  var isAvpVisualizationView = function isAvpVisualizationView(url) {
145
- return url.match(/^https:\/\/.*?\/avpviz\/c\/[^\/]+.*/);
164
+ return url.match(AVP_VISUALIZATION_VIEW_REGEX);
146
165
  };
147
166
  var isJiraWorkItem = exports.isJiraWorkItem = function isJiraWorkItem(url) {
148
- return /\/browse\/((?:\w+)-(?:\d+))/i.test(url);
167
+ return JIRA_WORK_ITEM_REGEX.test(url);
149
168
  };
150
169
 
151
170
  // Local UrlChecker-compatible wrapper around the boolean-returning
@@ -515,8 +534,8 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function (_No
515
534
  key: "doesUrlMatchPath",
516
535
  value: function doesUrlMatchPath(path, url) {
517
536
  // Using [a-zA-Z0-9] here instead of \w since that includes underscores
518
- var startingRegex = new RegExp(/^[a-zA-Z0-9]/).test(path) ? '(^|[^a-zA-Z0-9])' : '';
519
- var endingRegex = new RegExp(/[a-zA-Z0-9]$/).test(path) ? '($|[^a-zA-Z0-9])' : '';
537
+ var startingRegex = DOES_URL_MATCH_PATH_START_REGEX.test(path) ? '(^|[^a-zA-Z0-9])' : '';
538
+ var endingRegex = DOES_URL_MATCH_PATH_END_REGEX.test(path) ? '($|[^a-zA-Z0-9])' : '';
520
539
  var escapedPath = path.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
521
540
  var regexPattern = new RegExp("".concat(startingRegex).concat(escapedPath).concat(endingRegex));
522
541
  return regexPattern.test(url);
@@ -15,65 +15,90 @@ import { SmartCardLocalCacheClient } from './smart-card-local-cache-client';
15
15
  const BATCH_WAIT_TIME = 50;
16
16
  // Check if it is matching a Jira Roadmaps or Jira Timeline url
17
17
  // NOT to be confused with JSM timeline
18
- const isJiraRoadmapOrTimeline = url => url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/(timeline|roadmap)\/?/);
19
- const isPolarisView = url => url.match(/^https:\/\/.*?\/jira\/polaris\/projects\/[^\/]+?\/ideas\/view\/\d+$|^https:\/\/.*?\/secure\/JiraProductDiscoveryAnonymous\.jspa\?hash=\w+|^https:\/\/.*?\/jira\/polaris\/share\/\w+|^https:\/\/.*?\/jira\/discovery\/share\/views\/[\w-]+(\?selectedIssue=[\w-]+&issueViewLayout=sidebar&issueViewSection=[\w-]+)?$/);
20
- const isJwmView = url => url.match(/^https:\/\/.*?\/jira\/core\/projects\/[^\/]+?\/(timeline|calendar|list|board|summary|(form\/[^\/]+?))\/?/);
21
- const isJiraList = url => url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/list\/?/);
22
- const isGiphyMedia = url => url.match(/^https:\/\/(.*?\.)?giphy\.com\/(gifs|media|clips)\//);
23
- const isProformaView = url => url.match(/^https:\/\/[^/]+\/jira\/(core|software(\/c)?|servicedesk)\/projects\/\w+\/forms\/form\/direct\/\d+\/\d+.*$/);
24
- const isConfluenceWhiteboard = url =>
18
+ const JIRA_ROADMAP_OR_TIMELINE_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/(timeline|roadmap)\/?/;
19
+ const POLARIS_VIEW_REGEX = /^https:\/\/.*?\/jira\/polaris\/projects\/[^\/]+?\/ideas\/view\/\d+$|^https:\/\/.*?\/secure\/JiraProductDiscoveryAnonymous\.jspa\?hash=\w+|^https:\/\/.*?\/jira\/polaris\/share\/\w+|^https:\/\/.*?\/jira\/discovery\/share\/views\/[\w-]+(\?selectedIssue=[\w-]+&issueViewLayout=sidebar&issueViewSection=[\w-]+)?$/;
20
+ const JWM_VIEW_REGEX = /^https:\/\/.*?\/jira\/core\/projects\/[^\/]+?\/(timeline|calendar|list|board|summary|(form\/[^\/]+?))\/?/;
21
+ const JIRA_LIST_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/list\/?/;
22
+ const GIPHY_MEDIA_REGEX = /^https:\/\/(.*?\.)?giphy\.com\/(gifs|media|clips)\//;
23
+ const PROFORMA_VIEW_REGEX = /^https:\/\/[^/]+\/jira\/(core|software(\/c)?|servicedesk)\/projects\/\w+\/forms\/form\/direct\/\d+\/\d+.*$/;
24
+ // prettier-ignore
25
25
  // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
26
- url.match(/\/wiki\/spaces\/?.*\/whiteboard\/(?<resourceId>\d+)(\?\/)?/) || url.match(
26
+ const CONFLUENCE_WHITEBOARD_DECIMAL_REGEX = /\/wiki\/spaces\/?.*\/whiteboard\/(?<resourceId>\d+)(\?\/)?/;
27
+ // prettier-ignore
27
28
  // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
28
- /\/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})(\?\/)?/);
29
- const isConfluenceDatabase = url => url.match(/\/wiki\/spaces\/~?[\d\w]+\/database\/\d+(\?.*)?$/);
30
- const isYoutubeVideo = url => url.match(/^https:\/\/(.*?\.)?(youtube\..*?\/(watch\?|v\/|shorts\/)|youtu\.be)/);
29
+ const CONFLUENCE_WHITEBOARD_UUID_REGEX = /\/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})(\?\/)?/;
30
+ const CONFLUENCE_DATABASE_REGEX = /\/wiki\/spaces\/~?[\d\w]+\/database\/\d+(\?.*)?$/;
31
+ const YOUTUBE_VIDEO_REGEX = /^https:\/\/(.*?\.)?(youtube\..*?\/(watch\?|v\/|shorts\/)|youtu\.be)/;
32
+ // prettier-ignore
33
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
34
+ const LOOM_VIDEO_URL_REGEX = /^https:\/\/(.*?\.)?(loom\..*?\/(share|embed))\/([a-zA-Z0-9-]*-)?(?<videoId>[a-f0-9]{32})/;
35
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
36
+ const LOOM_SCREENSHOT_URL_REGEX = /^https:\/\/(.*?\.)?loom\..*?\/i\/(?<id>[a-f0-9]{32})/;
37
+ const JIRA_DASHBOARD_REGEX = /^https:\/\/.*?\/jira\/dashboards\/[0-9]+.*/;
38
+ const JIRA_BACKLOG_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\/backlog\??.*/;
39
+ const JIRA_BOARD_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\??.*/;
40
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
41
+ const JIRA_PLAN_REGEX = /https:\/\/.*?\/jira\/plans\/(?<resourceId>\d+)/;
42
+ // prettier-ignore
43
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
44
+ const JIRA_PLAN_WITH_SCENARIO_REGEX = /https:\/\/.*?\/jira\/plans\/(?<resourceId>\d+)\/scenarios\/(?<resourceContext>\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/;
45
+ const JIRA_VERSION_REGEX = /https:\/\/.*?\/projects\/[^\/]+?\/versions\/\d+\/tab\/release-report-all-issues/;
46
+ const JIRA_FORM_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/form\/\d\??.*/;
47
+ const JIRA_SUMMARY_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/summary/;
48
+ const ROVO_AGENT_PROFILE_PAGE_REGEX = /^https:\/\/.*?\/people\/agent\/.+$/;
49
+ const CUSTOMER_360_LANDING_PAGE_REGEX = /^https:\/\/customer\.atlassian\.com\/.*$/;
50
+ // prettier-ignore
51
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
52
+ const CONFLUENCE_TEAM_CALENDARS_REGEX = /\/wiki\/spaces\/(?<resourceContext>[^\/]+)\/calendars\/(?<resourceId>[a-zA-Z0-9-]+)/;
53
+ const JIRA_ISSUE_NAVIGATOR_REGEX = /^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/;
54
+ const AVP_VISUALIZATION_VIEW_REGEX = /^https:\/\/.*?\/avpviz\/c\/[^\/]+.*/;
55
+ const JIRA_WORK_ITEM_REGEX = /\/browse\/((?:\w+)-(?:\d+))/i;
56
+ const DOES_URL_MATCH_PATH_START_REGEX = /^[a-zA-Z0-9]/;
57
+ const DOES_URL_MATCH_PATH_END_REGEX = /[a-zA-Z0-9]$/;
58
+ const isJiraRoadmapOrTimeline = url => url.match(JIRA_ROADMAP_OR_TIMELINE_REGEX);
59
+ const isPolarisView = url => url.match(POLARIS_VIEW_REGEX);
60
+ const isJwmView = url => url.match(JWM_VIEW_REGEX);
61
+ const isJiraList = url => url.match(JIRA_LIST_REGEX);
62
+ const isGiphyMedia = url => url.match(GIPHY_MEDIA_REGEX);
63
+ const isProformaView = url => url.match(PROFORMA_VIEW_REGEX);
64
+ const isConfluenceWhiteboard = url => url.match(CONFLUENCE_WHITEBOARD_DECIMAL_REGEX) || url.match(CONFLUENCE_WHITEBOARD_UUID_REGEX);
65
+ const isConfluenceDatabase = url => url.match(CONFLUENCE_DATABASE_REGEX);
66
+ const isYoutubeVideo = url => url.match(YOUTUBE_VIDEO_REGEX);
31
67
  const isLoomVideoUrl = url => {
32
- return url.match(
33
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
34
- /^https:\/\/(.*?\.)?(loom\..*?\/(share|embed))\/([a-zA-Z0-9-]*-)?(?<videoId>[a-f0-9]{32})/);
68
+ return url.match(LOOM_VIDEO_URL_REGEX);
35
69
  };
36
70
  const isLoomScreenshotUrl = url => {
37
- return url.match(
38
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
39
- /^https:\/\/(.*?\.)?loom\..*?\/i\/(?<id>[a-f0-9]{32})/);
71
+ return url.match(LOOM_SCREENSHOT_URL_REGEX);
40
72
  };
41
73
  const isJiraDashboard = url => {
42
- return url.match(/^https:\/\/.*?\/jira\/dashboards\/[0-9]+.*/);
74
+ return url.match(JIRA_DASHBOARD_REGEX);
43
75
  };
44
76
  const isJiraBacklog = url => {
45
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\/backlog\??.*/);
77
+ return url.match(JIRA_BACKLOG_REGEX);
46
78
  };
47
79
  const isJiraBoard = url => {
48
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\??.*/);
80
+ return url.match(JIRA_BOARD_REGEX);
49
81
  };
50
82
  const isJiraPlan = url => {
51
- return (
52
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
53
- url.match(/https:\/\/.*?\/jira\/plans\/(?<resourceId>\d+)/) || url.match(
54
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
55
- /https:\/\/.*?\/jira\/plans\/(?<resourceId>\d+)\/scenarios\/(?<resourceContext>\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/)
56
- );
83
+ return url.match(JIRA_PLAN_REGEX) || url.match(JIRA_PLAN_WITH_SCENARIO_REGEX);
57
84
  };
58
85
  const isJiraVersion = url => {
59
- return url.match(/https:\/\/.*?\/projects\/[^\/]+?\/versions\/\d+\/tab\/release-report-all-issues/);
86
+ return url.match(JIRA_VERSION_REGEX);
60
87
  };
61
88
  const isJiraForm = url => {
62
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/form\/\d\??.*/);
89
+ return url.match(JIRA_FORM_REGEX);
63
90
  };
64
91
  const isJiraSummary = url => {
65
- return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/summary/);
92
+ return url.match(JIRA_SUMMARY_REGEX);
66
93
  };
67
94
  const isRovoAgentProfilePage = url => {
68
- return url.match(/^https:\/\/.*?\/people\/agent\/.+$/);
95
+ return url.match(ROVO_AGENT_PROFILE_PAGE_REGEX);
69
96
  };
70
- const isCustomer360LandingPage = url => url.match(/^https:\/\/customer\.atlassian\.com\/.*$/);
71
- const isConfluenceTeamCalendars = url =>
72
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
73
- url.match(/\/wiki\/spaces\/(?<resourceContext>[^\/]+)\/calendars\/(?<resourceId>[a-zA-Z0-9-]+)/);
74
- const isJiraIssueNavigator = url => url.match(/^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/);
75
- const isAvpVisualizationView = url => url.match(/^https:\/\/.*?\/avpviz\/c\/[^\/]+.*/);
76
- export const isJiraWorkItem = url => /\/browse\/((?:\w+)-(?:\d+))/i.test(url);
97
+ const isCustomer360LandingPage = url => url.match(CUSTOMER_360_LANDING_PAGE_REGEX);
98
+ const isConfluenceTeamCalendars = url => url.match(CONFLUENCE_TEAM_CALENDARS_REGEX);
99
+ const isJiraIssueNavigator = url => url.match(JIRA_ISSUE_NAVIGATOR_REGEX);
100
+ const isAvpVisualizationView = url => url.match(AVP_VISUALIZATION_VIEW_REGEX);
101
+ export const isJiraWorkItem = url => JIRA_WORK_ITEM_REGEX.test(url);
77
102
 
78
103
  // Local UrlChecker-compatible wrapper around the boolean-returning
79
104
  // `isConfluenceSlideUrl` from `./url-checkers` (the single source of truth for
@@ -269,8 +294,8 @@ export class EditorCardProvider extends NodeDataProvider {
269
294
  }
270
295
  doesUrlMatchPath(path, url) {
271
296
  // Using [a-zA-Z0-9] here instead of \w since that includes underscores
272
- const startingRegex = new RegExp(/^[a-zA-Z0-9]/).test(path) ? '(^|[^a-zA-Z0-9])' : '';
273
- const endingRegex = new RegExp(/[a-zA-Z0-9]$/).test(path) ? '($|[^a-zA-Z0-9])' : '';
297
+ const startingRegex = DOES_URL_MATCH_PATH_START_REGEX.test(path) ? '(^|[^a-zA-Z0-9])' : '';
298
+ const endingRegex = DOES_URL_MATCH_PATH_END_REGEX.test(path) ? '($|[^a-zA-Z0-9])' : '';
274
299
  const escapedPath = path.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
275
300
  const regexPattern = new RegExp(`${startingRegex}${escapedPath}${endingRegex}`);
276
301
  return regexPattern.test(url);
@@ -30,114 +30,133 @@ import { SmartCardLocalCacheClient } from './smart-card-local-cache-client';
30
30
  var BATCH_WAIT_TIME = 50;
31
31
  // Check if it is matching a Jira Roadmaps or Jira Timeline url
32
32
  // NOT to be confused with JSM timeline
33
+ var JIRA_ROADMAP_OR_TIMELINE_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/(timeline|roadmap)\/?/;
34
+ var POLARIS_VIEW_REGEX = /^https:\/\/.*?\/jira\/polaris\/projects\/[^\/]+?\/ideas\/view\/\d+$|^https:\/\/.*?\/secure\/JiraProductDiscoveryAnonymous\.jspa\?hash=\w+|^https:\/\/.*?\/jira\/polaris\/share\/\w+|^https:\/\/.*?\/jira\/discovery\/share\/views\/[\w-]+(\?selectedIssue=[\w-]+&issueViewLayout=sidebar&issueViewSection=[\w-]+)?$/;
35
+ var JWM_VIEW_REGEX = /^https:\/\/.*?\/jira\/core\/projects\/[^\/]+?\/(timeline|calendar|list|board|summary|(form\/[^\/]+?))\/?/;
36
+ var JIRA_LIST_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/list\/?/;
37
+ var GIPHY_MEDIA_REGEX = /^https:\/\/(.*?\.)?giphy\.com\/(gifs|media|clips)\//;
38
+ var PROFORMA_VIEW_REGEX = /^https:\/\/[^/]+\/jira\/(core|software(\/c)?|servicedesk)\/projects\/\w+\/forms\/form\/direct\/\d+\/\d+.*$/;
39
+ // prettier-ignore
40
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
41
+ var CONFLUENCE_WHITEBOARD_DECIMAL_REGEX = /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/?.*\/whiteboard\/(\d+)(\?\/)?/, {
42
+ resourceId: 1
43
+ });
44
+ // prettier-ignore
45
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
46
+ var CONFLUENCE_WHITEBOARD_UUID_REGEX = /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/?.*\/whiteboard\/([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})(\?\/)?/, {
47
+ resourceId: 1
48
+ });
49
+ var CONFLUENCE_DATABASE_REGEX = /\/wiki\/spaces\/~?[\d\w]+\/database\/\d+(\?.*)?$/;
50
+ var YOUTUBE_VIDEO_REGEX = /^https:\/\/(.*?\.)?(youtube\..*?\/(watch\?|v\/|shorts\/)|youtu\.be)/;
51
+ // prettier-ignore
52
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
53
+ var LOOM_VIDEO_URL_REGEX = /*#__PURE__*/_wrapRegExp(/^https:\/\/(.*?\.)?(loom\..*?\/(share|embed))\/([a-zA-Z0-9-]*-)?([a-f0-9]{32})/, {
54
+ videoId: 5
55
+ });
56
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
57
+ var LOOM_SCREENSHOT_URL_REGEX = /*#__PURE__*/_wrapRegExp(/^https:\/\/(.*?\.)?loom\..*?\/i\/([a-f0-9]{32})/, {
58
+ id: 2
59
+ });
60
+ var JIRA_DASHBOARD_REGEX = /^https:\/\/.*?\/jira\/dashboards\/[0-9]+.*/;
61
+ var JIRA_BACKLOG_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\/backlog\??.*/;
62
+ var JIRA_BOARD_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\??.*/;
63
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
64
+ var JIRA_PLAN_REGEX = /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)/, {
65
+ resourceId: 1
66
+ });
67
+ // prettier-ignore
68
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
69
+ var JIRA_PLAN_WITH_SCENARIO_REGEX = /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)\/scenarios\/(\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/, {
70
+ resourceId: 1,
71
+ resourceContext: 2
72
+ });
73
+ var JIRA_VERSION_REGEX = /https:\/\/.*?\/projects\/[^\/]+?\/versions\/\d+\/tab\/release-report-all-issues/;
74
+ var JIRA_FORM_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/form\/\d\??.*/;
75
+ var JIRA_SUMMARY_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/summary/;
76
+ var ROVO_AGENT_PROFILE_PAGE_REGEX = /^https:\/\/.*?\/people\/agent\/.+$/;
77
+ var CUSTOMER_360_LANDING_PAGE_REGEX = /^https:\/\/customer\.atlassian\.com\/.*$/;
78
+ // prettier-ignore
79
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
80
+ var CONFLUENCE_TEAM_CALENDARS_REGEX = /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/([^\/]+)\/calendars\/([a-zA-Z0-9-]+)/, {
81
+ resourceContext: 1,
82
+ resourceId: 2
83
+ });
84
+ var JIRA_ISSUE_NAVIGATOR_REGEX = /^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/;
85
+ var AVP_VISUALIZATION_VIEW_REGEX = /^https:\/\/.*?\/avpviz\/c\/[^\/]+.*/;
86
+ var JIRA_WORK_ITEM_REGEX = /\/browse\/((?:\w+)-(?:\d+))/i;
87
+ var DOES_URL_MATCH_PATH_START_REGEX = /^[a-zA-Z0-9]/;
88
+ var DOES_URL_MATCH_PATH_END_REGEX = /[a-zA-Z0-9]$/;
33
89
  var isJiraRoadmapOrTimeline = function isJiraRoadmapOrTimeline(url) {
34
- return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/(timeline|roadmap)\/?/);
90
+ return url.match(JIRA_ROADMAP_OR_TIMELINE_REGEX);
35
91
  };
36
92
  var isPolarisView = function isPolarisView(url) {
37
- return url.match(/^https:\/\/.*?\/jira\/polaris\/projects\/[^\/]+?\/ideas\/view\/\d+$|^https:\/\/.*?\/secure\/JiraProductDiscoveryAnonymous\.jspa\?hash=\w+|^https:\/\/.*?\/jira\/polaris\/share\/\w+|^https:\/\/.*?\/jira\/discovery\/share\/views\/[\w-]+(\?selectedIssue=[\w-]+&issueViewLayout=sidebar&issueViewSection=[\w-]+)?$/);
93
+ return url.match(POLARIS_VIEW_REGEX);
38
94
  };
39
95
  var isJwmView = function isJwmView(url) {
40
- return url.match(/^https:\/\/.*?\/jira\/core\/projects\/[^\/]+?\/(timeline|calendar|list|board|summary|(form\/[^\/]+?))\/?/);
96
+ return url.match(JWM_VIEW_REGEX);
41
97
  };
42
98
  var isJiraList = function isJiraList(url) {
43
- return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/list\/?/);
99
+ return url.match(JIRA_LIST_REGEX);
44
100
  };
45
101
  var isGiphyMedia = function isGiphyMedia(url) {
46
- return url.match(/^https:\/\/(.*?\.)?giphy\.com\/(gifs|media|clips)\//);
102
+ return url.match(GIPHY_MEDIA_REGEX);
47
103
  };
48
104
  var isProformaView = function isProformaView(url) {
49
- return url.match(/^https:\/\/[^/]+\/jira\/(core|software(\/c)?|servicedesk)\/projects\/\w+\/forms\/form\/direct\/\d+\/\d+.*$/);
105
+ return url.match(PROFORMA_VIEW_REGEX);
50
106
  };
51
107
  var isConfluenceWhiteboard = function isConfluenceWhiteboard(url) {
52
- return (
53
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
54
- url.match( /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/?.*\/whiteboard\/(\d+)(\?\/)?/, {
55
- resourceId: 1
56
- })) || url.match(
57
- /*#__PURE__*/
58
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
59
- _wrapRegExp(/\/wiki\/spaces\/?.*\/whiteboard\/([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})(\?\/)?/, {
60
- resourceId: 1
61
- }))
62
- );
108
+ return url.match(CONFLUENCE_WHITEBOARD_DECIMAL_REGEX) || url.match(CONFLUENCE_WHITEBOARD_UUID_REGEX);
63
109
  };
64
110
  var isConfluenceDatabase = function isConfluenceDatabase(url) {
65
- return url.match(/\/wiki\/spaces\/~?[\d\w]+\/database\/\d+(\?.*)?$/);
111
+ return url.match(CONFLUENCE_DATABASE_REGEX);
66
112
  };
67
113
  var isYoutubeVideo = function isYoutubeVideo(url) {
68
- return url.match(/^https:\/\/(.*?\.)?(youtube\..*?\/(watch\?|v\/|shorts\/)|youtu\.be)/);
114
+ return url.match(YOUTUBE_VIDEO_REGEX);
69
115
  };
70
116
  var isLoomVideoUrl = function isLoomVideoUrl(url) {
71
- return url.match(
72
- /*#__PURE__*/
73
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
74
- _wrapRegExp(/^https:\/\/(.*?\.)?(loom\..*?\/(share|embed))\/([a-zA-Z0-9-]*-)?([a-f0-9]{32})/, {
75
- videoId: 5
76
- }));
117
+ return url.match(LOOM_VIDEO_URL_REGEX);
77
118
  };
78
119
  var isLoomScreenshotUrl = function isLoomScreenshotUrl(url) {
79
- return url.match(
80
- /*#__PURE__*/
81
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
82
- _wrapRegExp(/^https:\/\/(.*?\.)?loom\..*?\/i\/([a-f0-9]{32})/, {
83
- id: 2
84
- }));
120
+ return url.match(LOOM_SCREENSHOT_URL_REGEX);
85
121
  };
86
122
  var isJiraDashboard = function isJiraDashboard(url) {
87
- return url.match(/^https:\/\/.*?\/jira\/dashboards\/[0-9]+.*/);
123
+ return url.match(JIRA_DASHBOARD_REGEX);
88
124
  };
89
125
  var isJiraBacklog = function isJiraBacklog(url) {
90
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\/backlog\??.*/);
126
+ return url.match(JIRA_BACKLOG_REGEX);
91
127
  };
92
128
  var isJiraBoard = function isJiraBoard(url) {
93
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\??.*/);
129
+ return url.match(JIRA_BOARD_REGEX);
94
130
  };
95
131
  var isJiraPlan = function isJiraPlan(url) {
96
- return (
97
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
98
- url.match( /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)/, {
99
- resourceId: 1
100
- })) || url.match(
101
- /*#__PURE__*/
102
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
103
- _wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)\/scenarios\/(\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/, {
104
- resourceId: 1,
105
- resourceContext: 2
106
- }))
107
- );
132
+ return url.match(JIRA_PLAN_REGEX) || url.match(JIRA_PLAN_WITH_SCENARIO_REGEX);
108
133
  };
109
134
  var isJiraVersion = function isJiraVersion(url) {
110
- return url.match(/https:\/\/.*?\/projects\/[^\/]+?\/versions\/\d+\/tab\/release-report-all-issues/);
135
+ return url.match(JIRA_VERSION_REGEX);
111
136
  };
112
137
  var isJiraForm = function isJiraForm(url) {
113
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/form\/\d\??.*/);
138
+ return url.match(JIRA_FORM_REGEX);
114
139
  };
115
140
  var isJiraSummary = function isJiraSummary(url) {
116
- return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/summary/);
141
+ return url.match(JIRA_SUMMARY_REGEX);
117
142
  };
118
143
  var isRovoAgentProfilePage = function isRovoAgentProfilePage(url) {
119
- return url.match(/^https:\/\/.*?\/people\/agent\/.+$/);
144
+ return url.match(ROVO_AGENT_PROFILE_PAGE_REGEX);
120
145
  };
121
146
  var isCustomer360LandingPage = function isCustomer360LandingPage(url) {
122
- return url.match(/^https:\/\/customer\.atlassian\.com\/.*$/);
147
+ return url.match(CUSTOMER_360_LANDING_PAGE_REGEX);
123
148
  };
124
149
  var isConfluenceTeamCalendars = function isConfluenceTeamCalendars(url) {
125
- return (
126
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
127
- url.match( /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/([^\/]+)\/calendars\/([a-zA-Z0-9-]+)/, {
128
- resourceContext: 1,
129
- resourceId: 2
130
- }))
131
- );
150
+ return url.match(CONFLUENCE_TEAM_CALENDARS_REGEX);
132
151
  };
133
152
  var isJiraIssueNavigator = function isJiraIssueNavigator(url) {
134
- return url.match(/^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/);
153
+ return url.match(JIRA_ISSUE_NAVIGATOR_REGEX);
135
154
  };
136
155
  var isAvpVisualizationView = function isAvpVisualizationView(url) {
137
- return url.match(/^https:\/\/.*?\/avpviz\/c\/[^\/]+.*/);
156
+ return url.match(AVP_VISUALIZATION_VIEW_REGEX);
138
157
  };
139
158
  export var isJiraWorkItem = function isJiraWorkItem(url) {
140
- return /\/browse\/((?:\w+)-(?:\d+))/i.test(url);
159
+ return JIRA_WORK_ITEM_REGEX.test(url);
141
160
  };
142
161
 
143
162
  // Local UrlChecker-compatible wrapper around the boolean-returning
@@ -507,8 +526,8 @@ export var EditorCardProvider = /*#__PURE__*/function (_NodeDataProvider) {
507
526
  key: "doesUrlMatchPath",
508
527
  value: function doesUrlMatchPath(path, url) {
509
528
  // Using [a-zA-Z0-9] here instead of \w since that includes underscores
510
- var startingRegex = new RegExp(/^[a-zA-Z0-9]/).test(path) ? '(^|[^a-zA-Z0-9])' : '';
511
- var endingRegex = new RegExp(/[a-zA-Z0-9]$/).test(path) ? '($|[^a-zA-Z0-9])' : '';
529
+ var startingRegex = DOES_URL_MATCH_PATH_START_REGEX.test(path) ? '(^|[^a-zA-Z0-9])' : '';
530
+ var endingRegex = DOES_URL_MATCH_PATH_END_REGEX.test(path) ? '($|[^a-zA-Z0-9])' : '';
512
531
  var escapedPath = path.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
513
532
  var regexPattern = new RegExp("".concat(startingRegex).concat(escapedPath).concat(endingRegex));
514
533
  return regexPattern.test(url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-card-provider",
3
- "version": "7.0.5",
3
+ "version": "7.0.7",
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",
@@ -31,7 +31,7 @@
31
31
  "@atlaskit/linking-types": "^15.0.0",
32
32
  "@atlaskit/node-data-provider": "^13.0.0",
33
33
  "@atlaskit/platform-feature-flags": "^2.0.0",
34
- "@atlaskit/tmp-editor-statsig": "^109.0.0",
34
+ "@atlaskit/tmp-editor-statsig": "^110.0.0",
35
35
  "@babel/runtime": "^7.0.0",
36
36
  "dataloader": "^2.1.0"
37
37
  },