@atlaskit/editor-card-provider 6.0.3 → 6.1.1
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 +17 -3
- package/README.md +25 -4
- package/dist/cjs/provider.js +4 -1
- package/dist/es2019/provider.js +2 -1
- package/dist/esm/provider.js +4 -1
- package/package.json +10 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-card-provider
|
|
2
2
|
|
|
3
|
+
## 6.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 6.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`7eefb2f8ae3d0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7eefb2f8ae3d0) -
|
|
14
|
+
Unfurl avp charts in embed by default behind FF
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 6.0.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -69,7 +86,6 @@
|
|
|
69
86
|
- [`6b61788ba65a2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6b61788ba65a2) - -
|
|
70
87
|
Added a new `custom` environment to `EnvironmentsKeys`. Now, you can pass the `baseUrlOverride`
|
|
71
88
|
parameter to both `EditorCardProvider` and `CardClient` to access a service directly.
|
|
72
|
-
|
|
73
89
|
- Introduced a new `setHeaders` method in CardClient, allowing you to specify custom HTTP headers
|
|
74
90
|
for requests to the object-resolver service.
|
|
75
91
|
- `EditorCardProvider` now supports passing a custom `CardClient` instance, so you can use your
|
|
@@ -89,7 +105,6 @@
|
|
|
89
105
|
- [`e5b3e00a23242`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e5b3e00a23242) - -
|
|
90
106
|
Added a new `custom` environment to `EnvironmentsKeys`. Now, you can pass the `baseUrlOverride`
|
|
91
107
|
parameter to both `EditorCardProvider` and `CardClient` to access a service directly.
|
|
92
|
-
|
|
93
108
|
- Introduced a new `setHeaders` method in CardClient, allowing you to specify custom HTTP headers
|
|
94
109
|
for requests to the object-resolver service.
|
|
95
110
|
- `EditorCardProvider` now supports passing a custom `CardClient` instance, so you can use your
|
|
@@ -109,7 +124,6 @@
|
|
|
109
124
|
- [`19da7355cd815`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/19da7355cd815) - -
|
|
110
125
|
Added a new `custom` environment to `EnvironmentsKeys`. Now, you can pass the `baseUrlOverride`
|
|
111
126
|
parameter to both `EditorCardProvider` and `CardClient` to access a service directly.
|
|
112
|
-
|
|
113
127
|
- Introduced a new `setHeaders` method in CardClient, allowing you to specify custom HTTP headers
|
|
114
128
|
for requests to the object-resolver service.
|
|
115
129
|
- `EditorCardProvider` now supports passing a custom `CardClient` instance, so you can use your
|
package/README.md
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
# @atlaskit/editor-card-provider
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Contains the EditorCardProvider, for determining smart card behaviour in the editor.
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
This package provides the EditorCardProvider class, which is designed to be used with the editor to determine smart card behavior. It manages smart card interactions, transformations, and API communications for link resolution and card rendering within the editor context.
|
|
8
|
+
|
|
9
|
+
## Key Features
|
|
10
|
+
|
|
11
|
+
### Provider
|
|
12
|
+
- **EditorCardProvider**: Main provider class for smart card behavior management
|
|
13
|
+
- **Environment Support**: Supports different environments (staging, production) with configurable base URLs
|
|
14
|
+
- **API Integration**: Handles API requests for card data and transformations
|
|
15
|
+
|
|
16
|
+
### Core Functionality
|
|
17
|
+
- **Card Data Management**: Fetches and manages smart card data
|
|
18
|
+
- **Link Resolution**: Resolves URLs to smart card representations
|
|
19
|
+
- **Transformations**: Handles data transformations for editor integration
|
|
20
|
+
- **Feature Flag Integration**: Supports platform feature flags for conditional behavior
|
|
3
21
|
|
|
4
22
|
## Usage
|
|
5
23
|
|
|
6
|
-
```
|
|
7
|
-
import { EditorCardProvider } from '@atlaskit/editor-card-provider'
|
|
24
|
+
```typescript
|
|
25
|
+
import { EditorCardProvider } from '@atlaskit/editor-card-provider';
|
|
8
26
|
|
|
9
27
|
// Default usage
|
|
10
28
|
const provider = new EditorCardProvider('stg');
|
|
@@ -12,5 +30,8 @@ const provider = new EditorCardProvider('stg');
|
|
|
12
30
|
// You may also pass in a base url override, if you'd like EditorCardProvider
|
|
13
31
|
// to make requests other than api-private.atlassian.com (prod) or pug.jira-dev.com (stg)
|
|
14
32
|
const provider = new EditorCardProvider('stg', 'www.acme.com/your-api-here');
|
|
15
|
-
|
|
16
33
|
```
|
|
34
|
+
|
|
35
|
+
## Team
|
|
36
|
+
|
|
37
|
+
**Editor: Lego**
|
package/dist/cjs/provider.js
CHANGED
|
@@ -126,6 +126,9 @@ var isConfluenceTeamCalendars = function isConfluenceTeamCalendars(url) {
|
|
|
126
126
|
var isJiraIssueNavigator = function isJiraIssueNavigator(url) {
|
|
127
127
|
return url.match(/^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/);
|
|
128
128
|
};
|
|
129
|
+
var isAvpVisualizationView = function isAvpVisualizationView(url) {
|
|
130
|
+
return url.match(/^https:\/\/.*?\/avpviz\/c\/[^\/]+.*/);
|
|
131
|
+
};
|
|
129
132
|
var isJiraWorkItem = exports.isJiraWorkItem = function isJiraWorkItem(url) {
|
|
130
133
|
return /\/browse\/((?:\w+)-(?:\d+))/i.test(url);
|
|
131
134
|
};
|
|
@@ -528,7 +531,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function (_re
|
|
|
528
531
|
if ((0, _platformFeatureFlags.fg)('tc_smart_link_embed_view')) {
|
|
529
532
|
isConfluenceTeamCalendarsEvaluated = isConfluenceTeamCalendars(url);
|
|
530
533
|
}
|
|
531
|
-
if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || isYoutubeVideo(url) || isLoomUrl(url) || isJiraDashboard(url) || isJiraBacklog(url) || isJiraBoard(url) || isRovoAgentProfilePage(url) || isJiraVersion(url) || isJiraPlanEvaluated || isJiraFormEvaluated || isJiraSummaryEvaluated || isCustomer360LandingPage(url) || isConfluenceTeamCalendarsEvaluated || isJiraIssueNavigator(url)) {
|
|
534
|
+
if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || isYoutubeVideo(url) || isLoomUrl(url) || isJiraDashboard(url) || isJiraBacklog(url) || isJiraBoard(url) || isRovoAgentProfilePage(url) || isJiraVersion(url) || isJiraPlanEvaluated || isJiraFormEvaluated || isJiraSummaryEvaluated || isCustomer360LandingPage(url) || isConfluenceTeamCalendarsEvaluated || isJiraIssueNavigator(url) || isAvpVisualizationView(url) && (0, _platformFeatureFlags.fg)('avp_unfurl_shared_charts_embed_by_default_2')) {
|
|
532
535
|
return 'embed';
|
|
533
536
|
}
|
|
534
537
|
}
|
package/dist/es2019/provider.js
CHANGED
|
@@ -65,6 +65,7 @@ const isConfluenceTeamCalendars = url =>
|
|
|
65
65
|
// @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
|
|
66
66
|
url.match(/\/wiki\/spaces\/(?<resourceContext>[^\/]+)\/calendars\/(?<resourceId>[a-zA-Z0-9-]+)/);
|
|
67
67
|
const isJiraIssueNavigator = url => url.match(/^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/);
|
|
68
|
+
const isAvpVisualizationView = url => url.match(/^https:\/\/.*?\/avpviz\/c\/[^\/]+.*/);
|
|
68
69
|
export const isJiraWorkItem = url => /\/browse\/((?:\w+)-(?:\d+))/i.test(url);
|
|
69
70
|
export class EditorCardProvider extends NodeDataProvider {
|
|
70
71
|
constructor(envKey, baseUrlOverride, product, onResolve, customCardClient) {
|
|
@@ -229,7 +230,7 @@ export class EditorCardProvider extends NodeDataProvider {
|
|
|
229
230
|
if (fg('tc_smart_link_embed_view')) {
|
|
230
231
|
isConfluenceTeamCalendarsEvaluated = isConfluenceTeamCalendars(url);
|
|
231
232
|
}
|
|
232
|
-
if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || isYoutubeVideo(url) || isLoomUrl(url) || isJiraDashboard(url) || isJiraBacklog(url) || isJiraBoard(url) || isRovoAgentProfilePage(url) || isJiraVersion(url) || isJiraPlanEvaluated || isJiraFormEvaluated || isJiraSummaryEvaluated || isCustomer360LandingPage(url) || isConfluenceTeamCalendarsEvaluated || isJiraIssueNavigator(url)) {
|
|
233
|
+
if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || isYoutubeVideo(url) || isLoomUrl(url) || isJiraDashboard(url) || isJiraBacklog(url) || isJiraBoard(url) || isRovoAgentProfilePage(url) || isJiraVersion(url) || isJiraPlanEvaluated || isJiraFormEvaluated || isJiraSummaryEvaluated || isCustomer360LandingPage(url) || isConfluenceTeamCalendarsEvaluated || isJiraIssueNavigator(url) || isAvpVisualizationView(url) && fg('avp_unfurl_shared_charts_embed_by_default_2')) {
|
|
233
234
|
return 'embed';
|
|
234
235
|
}
|
|
235
236
|
}
|
package/dist/esm/provider.js
CHANGED
|
@@ -121,6 +121,9 @@ var isConfluenceTeamCalendars = function isConfluenceTeamCalendars(url) {
|
|
|
121
121
|
var isJiraIssueNavigator = function isJiraIssueNavigator(url) {
|
|
122
122
|
return url.match(/^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/);
|
|
123
123
|
};
|
|
124
|
+
var isAvpVisualizationView = function isAvpVisualizationView(url) {
|
|
125
|
+
return url.match(/^https:\/\/.*?\/avpviz\/c\/[^\/]+.*/);
|
|
126
|
+
};
|
|
124
127
|
export var isJiraWorkItem = function isJiraWorkItem(url) {
|
|
125
128
|
return /\/browse\/((?:\w+)-(?:\d+))/i.test(url);
|
|
126
129
|
};
|
|
@@ -523,7 +526,7 @@ export var EditorCardProvider = /*#__PURE__*/function (_ref) {
|
|
|
523
526
|
if (fg('tc_smart_link_embed_view')) {
|
|
524
527
|
isConfluenceTeamCalendarsEvaluated = isConfluenceTeamCalendars(url);
|
|
525
528
|
}
|
|
526
|
-
if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || isYoutubeVideo(url) || isLoomUrl(url) || isJiraDashboard(url) || isJiraBacklog(url) || isJiraBoard(url) || isRovoAgentProfilePage(url) || isJiraVersion(url) || isJiraPlanEvaluated || isJiraFormEvaluated || isJiraSummaryEvaluated || isCustomer360LandingPage(url) || isConfluenceTeamCalendarsEvaluated || isJiraIssueNavigator(url)) {
|
|
529
|
+
if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || isYoutubeVideo(url) || isLoomUrl(url) || isJiraDashboard(url) || isJiraBacklog(url) || isJiraBoard(url) || isRovoAgentProfilePage(url) || isJiraVersion(url) || isJiraPlanEvaluated || isJiraFormEvaluated || isJiraSummaryEvaluated || isCustomer360LandingPage(url) || isConfluenceTeamCalendarsEvaluated || isJiraIssueNavigator(url) || isAvpVisualizationView(url) && fg('avp_unfurl_shared_charts_embed_by_default_2')) {
|
|
527
530
|
return 'embed';
|
|
528
531
|
}
|
|
529
532
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-card-provider",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.1",
|
|
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",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"atlaskit:src": "src/index.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/editor-json-transformer": "^8.
|
|
32
|
+
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
33
33
|
"@atlaskit/feature-gate-js-client": "^5.5.0",
|
|
34
34
|
"@atlaskit/json-ld-types": "^1.4.0",
|
|
35
35
|
"@atlaskit/link-client-extension": "^6.0.0",
|
|
36
36
|
"@atlaskit/link-extractors": "^2.4.0",
|
|
37
|
-
"@atlaskit/linking-common": "^9.
|
|
38
|
-
"@atlaskit/linking-types": "^14.
|
|
39
|
-
"@atlaskit/node-data-provider": "^7.
|
|
37
|
+
"@atlaskit/linking-common": "^9.8.0",
|
|
38
|
+
"@atlaskit/linking-types": "^14.2.0",
|
|
39
|
+
"@atlaskit/node-data-provider": "^7.5.0",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
41
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
41
|
+
"@atlaskit/tmp-editor-statsig": "^14.0.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0",
|
|
43
43
|
"dataloader": "^2.1.0"
|
|
44
44
|
},
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"react": "^18.2.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@atlassian/feature-flags-test-utils": "^0.
|
|
50
|
+
"@atlassian/feature-flags-test-utils": "^1.0.0"
|
|
51
51
|
},
|
|
52
52
|
"platform-feature-flags": {
|
|
53
53
|
"smartlink_jira_software_form": {
|
|
@@ -58,6 +58,9 @@
|
|
|
58
58
|
},
|
|
59
59
|
"issue-link-suggestions-in-comments": {
|
|
60
60
|
"type": "boolean"
|
|
61
|
+
},
|
|
62
|
+
"avp_unfurl_shared_charts_embed_by_default_2": {
|
|
63
|
+
"type": "boolean"
|
|
61
64
|
}
|
|
62
65
|
},
|
|
63
66
|
"compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/e145f3e3-514b-410f-a274-a92e6e6f9c47"
|