@atlaskit/editor-card-provider 3.8.1 → 3.9.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,22 @@
1
1
  # @atlaskit/editor-card-provider
2
2
 
3
+ ## 3.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#139456](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/139456)
8
+ [`a788f5ceac7a2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a788f5ceac7a2) -
9
+ [ux] Add optional forth optional parameter to EditorCardProvider.resolve method called
10
+ `isEmbedFriendlyLocation` which when given `false` value will prevent auto-conversion (on link
11
+ paste) to an embed based on FE speciafied regexp rules. If value is not given it will act as true
12
+ and remain old behaviour
13
+
14
+ ## 3.8.2
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 3.8.1
4
21
 
5
22
  ### Patch Changes
@@ -441,7 +441,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
441
441
  }, {
442
442
  key: "resolve",
443
443
  value: function () {
444
- var _resolve = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(url, appearance, shouldForceAppearance) {
444
+ var _resolve = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(url, appearance, shouldForceAppearance, isEmbedFriendlyLocation) {
445
445
  var hardCodedAppearance, _yield$Promise$all, _yield$Promise$all2, matchedProviderPattern, userPreference, isSupported, providerDefaultAppearance, preferredAppearance, canItBeEmbed, datasource, id, parameters;
446
446
  return _regenerator.default.wrap(function _callee10$(_context10) {
447
447
  while (1) switch (_context10.prev = _context10.next) {
@@ -491,7 +491,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
491
491
  userPreference ||
492
492
  // If user's default choice is "inline" or user hasn't specified preferences at all,
493
493
  // we check whatever one of the hardcoded providers match url (jira /timeline, polaris, etc)
494
- hardCodedAppearance ||
494
+ (isEmbedFriendlyLocation || isEmbedFriendlyLocation === undefined) && hardCodedAppearance ||
495
495
  // If non match, we see if this provider has default appearance for this particular regexp
496
496
  providerDefaultAppearance ||
497
497
  // If not, we pick what editor (or any other client) requested
@@ -544,7 +544,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
544
544
  }
545
545
  }, _callee10, this, [[0, 35]]);
546
546
  }));
547
- function resolve(_x8, _x9, _x10) {
547
+ function resolve(_x8, _x9, _x10, _x11) {
548
548
  return _resolve.apply(this, arguments);
549
549
  }
550
550
  return resolve;
@@ -173,7 +173,7 @@ export class EditorCardProvider {
173
173
  return undefined;
174
174
  }
175
175
  }
176
- async resolve(url, appearance, shouldForceAppearance) {
176
+ async resolve(url, appearance, shouldForceAppearance, isEmbedFriendlyLocation) {
177
177
  try {
178
178
  if (shouldForceAppearance === true) {
179
179
  // At this point we don't need to check pattern nor call `check` because manual change means
@@ -197,7 +197,7 @@ export class EditorCardProvider {
197
197
  userPreference ||
198
198
  // If user's default choice is "inline" or user hasn't specified preferences at all,
199
199
  // we check whatever one of the hardcoded providers match url (jira /timeline, polaris, etc)
200
- hardCodedAppearance ||
200
+ (isEmbedFriendlyLocation || isEmbedFriendlyLocation === undefined) && hardCodedAppearance ||
201
201
  // If non match, we see if this provider has default appearance for this particular regexp
202
202
  providerDefaultAppearance ||
203
203
  // If not, we pick what editor (or any other client) requested
@@ -433,7 +433,7 @@ export var EditorCardProvider = /*#__PURE__*/function () {
433
433
  }, {
434
434
  key: "resolve",
435
435
  value: function () {
436
- var _resolve = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(url, appearance, shouldForceAppearance) {
436
+ var _resolve = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(url, appearance, shouldForceAppearance, isEmbedFriendlyLocation) {
437
437
  var hardCodedAppearance, _yield$Promise$all, _yield$Promise$all2, matchedProviderPattern, userPreference, isSupported, providerDefaultAppearance, preferredAppearance, canItBeEmbed, datasource, id, parameters;
438
438
  return _regeneratorRuntime.wrap(function _callee10$(_context10) {
439
439
  while (1) switch (_context10.prev = _context10.next) {
@@ -483,7 +483,7 @@ export var EditorCardProvider = /*#__PURE__*/function () {
483
483
  userPreference ||
484
484
  // If user's default choice is "inline" or user hasn't specified preferences at all,
485
485
  // we check whatever one of the hardcoded providers match url (jira /timeline, polaris, etc)
486
- hardCodedAppearance ||
486
+ (isEmbedFriendlyLocation || isEmbedFriendlyLocation === undefined) && hardCodedAppearance ||
487
487
  // If non match, we see if this provider has default appearance for this particular regexp
488
488
  providerDefaultAppearance ||
489
489
  // If not, we pick what editor (or any other client) requested
@@ -536,7 +536,7 @@ export var EditorCardProvider = /*#__PURE__*/function () {
536
536
  }
537
537
  }, _callee10, this, [[0, 35]]);
538
538
  }));
539
- function resolve(_x8, _x9, _x10) {
539
+ function resolve(_x8, _x9, _x10, _x11) {
540
540
  return _resolve.apply(this, arguments);
541
541
  }
542
542
  return resolve;
@@ -36,7 +36,7 @@ export declare class EditorCardProvider implements CardProvider {
36
36
  * Make a /resolve call and find out if result has datasource capability
37
37
  */
38
38
  private getDatasourceFromResolveResponse;
39
- resolve(url: string, appearance: CardAppearance, shouldForceAppearance?: boolean): Promise<CardAdf | DatasourceAdf>;
39
+ resolve(url: string, appearance: CardAppearance, shouldForceAppearance?: boolean, isEmbedFriendlyLocation?: boolean): Promise<CardAdf | DatasourceAdf>;
40
40
  }
41
41
  export declare const editorCardProvider: EditorCardProvider;
42
42
  export type { CardProvider } from './types';
@@ -1,6 +1,6 @@
1
1
  import { type CardAppearance } from '@atlaskit/linking-common';
2
2
  export interface CardProvider {
3
- resolve(url: string, appearance: CardAppearance, shouldForceAppearance?: boolean): Promise<any>;
3
+ resolve(url: string, appearance: CardAppearance, shouldForceAppearance?: boolean, isEmbedFriendlyLocation?: boolean): Promise<any>;
4
4
  }
5
5
  export type ORSCheckResponse = {
6
6
  isSupported: boolean;
@@ -36,7 +36,7 @@ export declare class EditorCardProvider implements CardProvider {
36
36
  * Make a /resolve call and find out if result has datasource capability
37
37
  */
38
38
  private getDatasourceFromResolveResponse;
39
- resolve(url: string, appearance: CardAppearance, shouldForceAppearance?: boolean): Promise<CardAdf | DatasourceAdf>;
39
+ resolve(url: string, appearance: CardAppearance, shouldForceAppearance?: boolean, isEmbedFriendlyLocation?: boolean): Promise<CardAdf | DatasourceAdf>;
40
40
  }
41
41
  export declare const editorCardProvider: EditorCardProvider;
42
42
  export type { CardProvider } from './types';
@@ -1,6 +1,6 @@
1
1
  import { type CardAppearance } from '@atlaskit/linking-common';
2
2
  export interface CardProvider {
3
- resolve(url: string, appearance: CardAppearance, shouldForceAppearance?: boolean): Promise<any>;
3
+ resolve(url: string, appearance: CardAppearance, shouldForceAppearance?: boolean, isEmbedFriendlyLocation?: boolean): Promise<any>;
4
4
  }
5
5
  export type ORSCheckResponse = {
6
6
  isSupported: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-card-provider",
3
- "version": "3.8.1",
3
+ "version": "3.9.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",
@@ -33,8 +33,8 @@
33
33
  ".": "./src/index.ts"
34
34
  },
35
35
  "dependencies": {
36
- "@atlaskit/eslint-plugin-platform": "0.7.4",
37
- "@atlaskit/link-client-extension": "^2.3.0",
36
+ "@atlaskit/eslint-plugin-platform": "0.7.5",
37
+ "@atlaskit/link-client-extension": "^2.4.0",
38
38
  "@atlaskit/link-extractors": "^1.9.0",
39
39
  "@atlaskit/linking-common": "^5.11.0",
40
40
  "@babel/runtime": "^7.0.0",