@atlaskit/editor-card-provider 6.6.19 → 6.7.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,21 @@
1
1
  # @atlaskit/editor-card-provider
2
2
 
3
+ ## 6.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`51d860f32cd31`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/51d860f32cd31) -
8
+ Force 16:9 aspect ratio for Confluence Slides embeds.
9
+ - `editor-card-provider`: Added `isConfluenceSlideUrl()` URL checker and exported it via
10
+ `./url-checkers` subpath; slide URLs now always resolve to `'embed'` appearance via
11
+ `getHardCodedAppearance()`
12
+ - `editor-plugin-card`: In `onResolve()`, overrides the ORS-resolved aspect ratio with `16/9` when
13
+ the URL is a Confluence Slide
14
+ - `native-embeds-slide-experience`: Added `parameterDefaults: { width: 960, height: 540 }` to
15
+ `SlideExperienceManifest` so slides get a 16:9 aspect-ratio container
16
+ - `native-embeds-editor-extension`: Falls back to `manifest.parameterDefaults` for width/height
17
+ when the ADF node has no explicit dimensions
18
+
3
19
  ## 6.6.19
4
20
 
5
21
  ### Patch Changes
@@ -26,6 +26,7 @@ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
26
26
  var _linkingCommon = require("@atlaskit/linking-common");
27
27
  var _dataloader = _interopRequireDefault(require("dataloader"));
28
28
  var _transformer = require("./transformer");
29
+ var _urlCheckers = require("./url-checkers");
29
30
  var _linkProvider = require("@atlaskit/link-provider");
30
31
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
31
32
  var _api = require("./api");
@@ -146,6 +147,18 @@ var isAvpVisualizationView = function isAvpVisualizationView(url) {
146
147
  var isJiraWorkItem = exports.isJiraWorkItem = function isJiraWorkItem(url) {
147
148
  return /\/browse\/((?:\w+)-(?:\d+))/i.test(url);
148
149
  };
150
+
151
+ // Local UrlChecker-compatible wrapper around the boolean-returning
152
+ // `isConfluenceSlideUrl` from `./url-checkers` (the single source of truth for
153
+ // slide URL matching). Wrapping (rather than aliasing the imported identifier
154
+ // directly inside the exported `internalUrlCheckers` object) avoids the
155
+ // @atlaskit/editor/no-re-export lint rule and gives the registry a uniform
156
+ // `(url) => RegExpMatchArray | null` signature. Consumers of
157
+ // `internalUrlCheckers` only check the truthiness of the result, so returning
158
+ // a synthetic single-element match array (or `null`) preserves behaviour.
159
+ var isConfluenceSlide = function isConfluenceSlide(url) {
160
+ return (0, _urlCheckers.isConfluenceSlideUrl)(url) ? [url] : null;
161
+ };
149
162
  var internalUrlCheckers = exports.internalUrlCheckers = {
150
163
  isJiraRoadmapOrTimeline: isJiraRoadmapOrTimeline,
151
164
  isPolarisView: isPolarisView,
@@ -153,6 +166,7 @@ var internalUrlCheckers = exports.internalUrlCheckers = {
153
166
  isJiraList: isJiraList,
154
167
  isConfluenceWhiteboard: isConfluenceWhiteboard,
155
168
  isConfluenceDatabase: isConfluenceDatabase,
169
+ isConfluenceSlide: isConfluenceSlide,
156
170
  isJiraDashboard: isJiraDashboard,
157
171
  isJiraBacklog: isJiraBacklog,
158
172
  isJiraBoard: isJiraBoard,
@@ -596,7 +610,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function (_re
596
610
  if ((0, _platformFeatureFlags.fg)('tc_smart_link_embed_view')) {
597
611
  isConfluenceTeamCalendarsEvaluated = isConfluenceTeamCalendars(url);
598
612
  }
599
- if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || isYoutubeVideo(url) || isLoomVideoUrl(url) || isLoomScreenshotUrl(url) && (0, _platformFeatureFlags.fg)('loom-support-screenshot-sl-resolution') || 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')) {
613
+ if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || (0, _urlCheckers.isConfluenceSlideUrl)(url) || isYoutubeVideo(url) || isLoomVideoUrl(url) || isLoomScreenshotUrl(url) && (0, _platformFeatureFlags.fg)('loom-support-screenshot-sl-resolution') || 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')) {
600
614
  return 'embed';
601
615
  }
602
616
  }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isConfluenceSlideUrl = void 0;
7
+ /**
8
+ * URL checker utilities for Confluence content types.
9
+ *
10
+ * Exported via the `@atlaskit/editor-card-provider/url-checkers` subpath
11
+ * so consumers don't have to depend on the barrel file.
12
+ */
13
+
14
+ /**
15
+ * Matches Confluence Slides URLs.
16
+ *
17
+ * Examples:
18
+ * - /wiki/spaces/TEAM/slide/12345
19
+ * - /wiki/spaces/~uid/slide/8fb8c642-803d-59fe-8d1c-066610e860c6
20
+ */
21
+ // eslint-disable-next-line require-unicode-regexp -- consistent with isConfluenceDatabase in provider.ts
22
+ var CONFLUENCE_SLIDE_URL_PATTERN = /\/wiki\/spaces\/~?[\d\w]+\/slide\/[\d\w-]+(\?.*)?$/;
23
+
24
+ /**
25
+ * Returns `true` when the given URL points to a Confluence Slides page.
26
+ */
27
+ var isConfluenceSlideUrl = exports.isConfluenceSlideUrl = function isConfluenceSlideUrl(url) {
28
+ return CONFLUENCE_SLIDE_URL_PATTERN.test(url);
29
+ };
@@ -7,6 +7,7 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
7
  import { getStatus, getBaseUrl, getResolverUrl } from '@atlaskit/linking-common';
8
8
  import DataLoader from 'dataloader';
9
9
  import { Transformer } from './transformer';
10
+ import { isConfluenceSlideUrl } from './url-checkers';
10
11
  import { CardClient } from '@atlaskit/link-provider';
11
12
  import { fg } from '@atlaskit/platform-feature-flags';
12
13
  import { request } from './api';
@@ -73,6 +74,16 @@ url.match(/\/wiki\/spaces\/(?<resourceContext>[^\/]+)\/calendars\/(?<resourceId>
73
74
  const isJiraIssueNavigator = url => url.match(/^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/);
74
75
  const isAvpVisualizationView = url => url.match(/^https:\/\/.*?\/avpviz\/c\/[^\/]+.*/);
75
76
  export const isJiraWorkItem = url => /\/browse\/((?:\w+)-(?:\d+))/i.test(url);
77
+
78
+ // Local UrlChecker-compatible wrapper around the boolean-returning
79
+ // `isConfluenceSlideUrl` from `./url-checkers` (the single source of truth for
80
+ // slide URL matching). Wrapping (rather than aliasing the imported identifier
81
+ // directly inside the exported `internalUrlCheckers` object) avoids the
82
+ // @atlaskit/editor/no-re-export lint rule and gives the registry a uniform
83
+ // `(url) => RegExpMatchArray | null` signature. Consumers of
84
+ // `internalUrlCheckers` only check the truthiness of the result, so returning
85
+ // a synthetic single-element match array (or `null`) preserves behaviour.
86
+ const isConfluenceSlide = url => isConfluenceSlideUrl(url) ? [url] : null;
76
87
  export const internalUrlCheckers = {
77
88
  isJiraRoadmapOrTimeline,
78
89
  isPolarisView,
@@ -80,6 +91,7 @@ export const internalUrlCheckers = {
80
91
  isJiraList,
81
92
  isConfluenceWhiteboard,
82
93
  isConfluenceDatabase,
94
+ isConfluenceSlide,
83
95
  isJiraDashboard,
84
96
  isJiraBacklog,
85
97
  isJiraBoard,
@@ -302,7 +314,7 @@ export class EditorCardProvider extends NodeDataProvider {
302
314
  if (fg('tc_smart_link_embed_view')) {
303
315
  isConfluenceTeamCalendarsEvaluated = isConfluenceTeamCalendars(url);
304
316
  }
305
- if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || isYoutubeVideo(url) || isLoomVideoUrl(url) || isLoomScreenshotUrl(url) && fg('loom-support-screenshot-sl-resolution') || 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')) {
317
+ if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || isConfluenceSlideUrl(url) || isYoutubeVideo(url) || isLoomVideoUrl(url) || isLoomScreenshotUrl(url) && fg('loom-support-screenshot-sl-resolution') || 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')) {
306
318
  return 'embed';
307
319
  }
308
320
  }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * URL checker utilities for Confluence content types.
3
+ *
4
+ * Exported via the `@atlaskit/editor-card-provider/url-checkers` subpath
5
+ * so consumers don't have to depend on the barrel file.
6
+ */
7
+
8
+ /**
9
+ * Matches Confluence Slides URLs.
10
+ *
11
+ * Examples:
12
+ * - /wiki/spaces/TEAM/slide/12345
13
+ * - /wiki/spaces/~uid/slide/8fb8c642-803d-59fe-8d1c-066610e860c6
14
+ */
15
+ // eslint-disable-next-line require-unicode-regexp -- consistent with isConfluenceDatabase in provider.ts
16
+ const CONFLUENCE_SLIDE_URL_PATTERN = /\/wiki\/spaces\/~?[\d\w]+\/slide\/[\d\w-]+(\?.*)?$/;
17
+
18
+ /**
19
+ * Returns `true` when the given URL points to a Confluence Slides page.
20
+ */
21
+ export const isConfluenceSlideUrl = url => CONFLUENCE_SLIDE_URL_PATTERN.test(url);
@@ -22,6 +22,7 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
22
22
  import { getStatus, getBaseUrl, getResolverUrl } from '@atlaskit/linking-common';
23
23
  import DataLoader from 'dataloader';
24
24
  import { Transformer } from './transformer';
25
+ import { isConfluenceSlideUrl } from './url-checkers';
25
26
  import { CardClient } from '@atlaskit/link-provider';
26
27
  import { fg } from '@atlaskit/platform-feature-flags';
27
28
  import { request } from './api';
@@ -138,6 +139,18 @@ var isAvpVisualizationView = function isAvpVisualizationView(url) {
138
139
  export var isJiraWorkItem = function isJiraWorkItem(url) {
139
140
  return /\/browse\/((?:\w+)-(?:\d+))/i.test(url);
140
141
  };
142
+
143
+ // Local UrlChecker-compatible wrapper around the boolean-returning
144
+ // `isConfluenceSlideUrl` from `./url-checkers` (the single source of truth for
145
+ // slide URL matching). Wrapping (rather than aliasing the imported identifier
146
+ // directly inside the exported `internalUrlCheckers` object) avoids the
147
+ // @atlaskit/editor/no-re-export lint rule and gives the registry a uniform
148
+ // `(url) => RegExpMatchArray | null` signature. Consumers of
149
+ // `internalUrlCheckers` only check the truthiness of the result, so returning
150
+ // a synthetic single-element match array (or `null`) preserves behaviour.
151
+ var isConfluenceSlide = function isConfluenceSlide(url) {
152
+ return isConfluenceSlideUrl(url) ? [url] : null;
153
+ };
141
154
  export var internalUrlCheckers = {
142
155
  isJiraRoadmapOrTimeline: isJiraRoadmapOrTimeline,
143
156
  isPolarisView: isPolarisView,
@@ -145,6 +158,7 @@ export var internalUrlCheckers = {
145
158
  isJiraList: isJiraList,
146
159
  isConfluenceWhiteboard: isConfluenceWhiteboard,
147
160
  isConfluenceDatabase: isConfluenceDatabase,
161
+ isConfluenceSlide: isConfluenceSlide,
148
162
  isJiraDashboard: isJiraDashboard,
149
163
  isJiraBacklog: isJiraBacklog,
150
164
  isJiraBoard: isJiraBoard,
@@ -588,7 +602,7 @@ export var EditorCardProvider = /*#__PURE__*/function (_ref) {
588
602
  if (fg('tc_smart_link_embed_view')) {
589
603
  isConfluenceTeamCalendarsEvaluated = isConfluenceTeamCalendars(url);
590
604
  }
591
- if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || isYoutubeVideo(url) || isLoomVideoUrl(url) || isLoomScreenshotUrl(url) && fg('loom-support-screenshot-sl-resolution') || 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')) {
605
+ if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || isConfluenceSlideUrl(url) || isYoutubeVideo(url) || isLoomVideoUrl(url) || isLoomScreenshotUrl(url) && fg('loom-support-screenshot-sl-resolution') || 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')) {
592
606
  return 'embed';
593
607
  }
594
608
  }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * URL checker utilities for Confluence content types.
3
+ *
4
+ * Exported via the `@atlaskit/editor-card-provider/url-checkers` subpath
5
+ * so consumers don't have to depend on the barrel file.
6
+ */
7
+
8
+ /**
9
+ * Matches Confluence Slides URLs.
10
+ *
11
+ * Examples:
12
+ * - /wiki/spaces/TEAM/slide/12345
13
+ * - /wiki/spaces/~uid/slide/8fb8c642-803d-59fe-8d1c-066610e860c6
14
+ */
15
+ // eslint-disable-next-line require-unicode-regexp -- consistent with isConfluenceDatabase in provider.ts
16
+ var CONFLUENCE_SLIDE_URL_PATTERN = /\/wiki\/spaces\/~?[\d\w]+\/slide\/[\d\w-]+(\?.*)?$/;
17
+
18
+ /**
19
+ * Returns `true` when the given URL points to a Confluence Slides page.
20
+ */
21
+ export var isConfluenceSlideUrl = function isConfluenceSlideUrl(url) {
22
+ return CONFLUENCE_SLIDE_URL_PATTERN.test(url);
23
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * URL checker utilities for Confluence content types.
3
+ *
4
+ * Exported via the `@atlaskit/editor-card-provider/url-checkers` subpath
5
+ * so consumers don't have to depend on the barrel file.
6
+ */
7
+ /**
8
+ * Returns `true` when the given URL points to a Confluence Slides page.
9
+ */
10
+ export declare const isConfluenceSlideUrl: (url: string) => boolean;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * URL checker utilities for Confluence content types.
3
+ *
4
+ * Exported via the `@atlaskit/editor-card-provider/url-checkers` subpath
5
+ * so consumers don't have to depend on the barrel file.
6
+ */
7
+ /**
8
+ * Returns `true` when the given URL points to a Confluence Slides page.
9
+ */
10
+ export declare const isConfluenceSlideUrl: (url: string) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-card-provider",
3
- "version": "6.6.19",
3
+ "version": "6.7.0",
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",
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/editor-card-provider/url-checkers",
3
+ "main": "../dist/cjs/url-checkers.js",
4
+ "module": "../dist/esm/url-checkers.js",
5
+ "module:es2019": "../dist/es2019/url-checkers.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/url-checkers.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <5.9": {
10
+ "*": [
11
+ "../dist/types-ts4.5/url-checkers.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }