@atlaskit/editor-common 77.1.1 → 77.2.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-common
2
2
 
3
+ ## 77.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#70612](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70612) [`87457cd97d6b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/87457cd97d6b) - [ux] Added a new `datasourceAppearanceTitle` i18n message.
8
+
9
+ ### Patch Changes
10
+
11
+ - [#68372](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68372) [`17f42e77e826`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/17f42e77e826) - add allowMediaInlineImage media option to support new media inline image feature
12
+ - Updated dependencies
13
+
14
+ ## 77.1.2
15
+
16
+ ### Patch Changes
17
+
18
+ - [#70373](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70373) [`fdcf1d5c6b11`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fdcf1d5c6b11) - Fix duplicate I18N IDs for media toolbar
19
+
3
20
  ## 77.1.1
4
21
 
5
22
  ### Patch Changes
@@ -45,14 +45,14 @@ Object.defineProperty(exports, "mediaInlineImageStyles", {
45
45
  return _styles.mediaInlineImageStyles;
46
46
  }
47
47
  });
48
- Object.defineProperty(exports, "shouldShowInlineImage", {
48
+ Object.defineProperty(exports, "mediaInlineImagesEnabled", {
49
49
  enumerable: true,
50
50
  get: function get() {
51
- return _utils.shouldShowInlineImage;
51
+ return _utils.mediaInlineImagesEnabled;
52
52
  }
53
53
  });
54
54
  var _mediaInlineImageCard = require("./media-inline-image-card");
55
- var _utils = require("./utils");
56
55
  var _inlineImageWrapper = require("./inline-image-wrapper");
57
56
  var _constants = require("./constants");
58
- var _styles = require("./styles");
57
+ var _styles = require("./styles");
58
+ var _utils = require("./utils");
@@ -3,11 +3,18 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.shouldShowInlineImage = void 0;
6
+ exports.mediaInlineImagesEnabled = void 0;
7
7
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
8
- var shouldShowInlineImage = exports.shouldShowInlineImage = function shouldShowInlineImage(mediaType) {
9
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.media.inline-image.base-support')) {
10
- return mediaType === 'image';
11
- }
12
- return false;
8
+ /**
9
+ * Enable media inline images feature based on
10
+ * mediaOptions.featureFlags.mediaInline, mediaOptions.allowMediaInlineImages and platform FF platform.editor.media.inline-image.base-support
11
+ *
12
+ * The reason not using mediaOption as param is because MediaOption is from editor-plugin-media
13
+ * we want to avoid circular deps
14
+ * @param allowMediaInline MediaOptions.featureFlags.mediaInline
15
+ * @param allowMediaInlineImages MediaOptions.allowMediaInlineImages
16
+ * @returns boolean
17
+ */
18
+ var mediaInlineImagesEnabled = exports.mediaInlineImagesEnabled = function mediaInlineImagesEnabled(allowMediaInline, allowMediaInlineImages) {
19
+ return allowMediaInline && allowMediaInlineImages && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.media.inline-image.base-support');
13
20
  };
@@ -91,6 +91,11 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
91
91
  defaultMessage: 'Edit search query',
92
92
  description: 'Tooltip of button to edit a card into a datasource'
93
93
  },
94
+ datasourceAppearanceTitle: {
95
+ id: 'fabric.editor.datasourceAppearanceTitle',
96
+ defaultMessage: 'Table',
97
+ description: 'Tooltip of button to change to datasource table appearance'
98
+ },
94
99
  datasourceJiraIssue: {
95
100
  id: 'fabric.editor.datasource.jiraIssue',
96
101
  defaultMessage: 'Jira Issues',
@@ -22,12 +22,12 @@ var toolbarMessages = exports.toolbarMessages = (0, _reactIntlNext.defineMessage
22
22
  description: 'In the context of a media inline image, it allows the user to convert it to media single'
23
23
  },
24
24
  changeToMediaInlineImage: {
25
- id: 'fabric.editor.media_change_mediainline',
25
+ id: 'fabric.editor.media_change_mediainline_default',
26
26
  defaultMessage: 'Inline',
27
27
  description: 'In the context of media single contains media node, it allows the user to convert media single to media inline image'
28
28
  },
29
- changeToMediaInlineImageCaptionWanrning: {
30
- id: 'fabric.editor.media_change_mediainline',
29
+ changeToMediaInlineImageCaptionWarning: {
30
+ id: 'fabric.editor.media_change_mediainline_caption_warn',
31
31
  defaultMessage: 'Inline (caption will be removed)',
32
32
  description: 'In the context of media single contains media node, it allows the user to convert media single to media inline image and warn user about caption being removed'
33
33
  }
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "77.1.1";
19
+ var packageVersion = "77.2.0";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // TODO: Sanitise the URL instead of just removing it
@@ -22,7 +22,7 @@ var _templateObject, _templateObject2, _templateObject3;
22
22
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
23
23
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
24
24
  var packageName = "@atlaskit/editor-common";
25
- var packageVersion = "77.1.1";
25
+ var packageVersion = "77.2.0";
26
26
  var halfFocusRing = 1;
27
27
  var dropOffset = '0, 8';
28
28
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1,6 +1,6 @@
1
1
  export { MediaInlineImageCard } from './media-inline-image-card';
2
- export { shouldShowInlineImage } from './utils';
3
2
  export { InlineImageWrapper } from './inline-image-wrapper';
4
3
  export { DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT } from './constants';
5
4
  export { DEFAULT_INLINE_IMAGE_ASPECT_RATIO } from './constants';
6
- export { mediaInlineImageStyles, INLINE_IMAGE_WRAPPER_CLASS_NAME } from './styles';
5
+ export { mediaInlineImageStyles, INLINE_IMAGE_WRAPPER_CLASS_NAME } from './styles';
6
+ export { mediaInlineImagesEnabled } from './utils';
@@ -1,7 +1,15 @@
1
1
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
2
- export const shouldShowInlineImage = mediaType => {
3
- if (getBooleanFF('platform.editor.media.inline-image.base-support')) {
4
- return mediaType === 'image';
5
- }
6
- return false;
2
+
3
+ /**
4
+ * Enable media inline images feature based on
5
+ * mediaOptions.featureFlags.mediaInline, mediaOptions.allowMediaInlineImages and platform FF platform.editor.media.inline-image.base-support
6
+ *
7
+ * The reason not using mediaOption as param is because MediaOption is from editor-plugin-media
8
+ * we want to avoid circular deps
9
+ * @param allowMediaInline MediaOptions.featureFlags.mediaInline
10
+ * @param allowMediaInlineImages MediaOptions.allowMediaInlineImages
11
+ * @returns boolean
12
+ */
13
+ export const mediaInlineImagesEnabled = (allowMediaInline, allowMediaInlineImages) => {
14
+ return allowMediaInline && allowMediaInlineImages && getBooleanFF('platform.editor.media.inline-image.base-support');
7
15
  };
@@ -85,6 +85,11 @@ export const messages = defineMessages({
85
85
  defaultMessage: 'Edit search query',
86
86
  description: 'Tooltip of button to edit a card into a datasource'
87
87
  },
88
+ datasourceAppearanceTitle: {
89
+ id: 'fabric.editor.datasourceAppearanceTitle',
90
+ defaultMessage: 'Table',
91
+ description: 'Tooltip of button to change to datasource table appearance'
92
+ },
88
93
  datasourceJiraIssue: {
89
94
  id: 'fabric.editor.datasource.jiraIssue',
90
95
  defaultMessage: 'Jira Issues',
@@ -16,12 +16,12 @@ export const toolbarMessages = defineMessages({
16
16
  description: 'In the context of a media inline image, it allows the user to convert it to media single'
17
17
  },
18
18
  changeToMediaInlineImage: {
19
- id: 'fabric.editor.media_change_mediainline',
19
+ id: 'fabric.editor.media_change_mediainline_default',
20
20
  defaultMessage: 'Inline',
21
21
  description: 'In the context of media single contains media node, it allows the user to convert media single to media inline image'
22
22
  },
23
- changeToMediaInlineImageCaptionWanrning: {
24
- id: 'fabric.editor.media_change_mediainline',
23
+ changeToMediaInlineImageCaptionWarning: {
24
+ id: 'fabric.editor.media_change_mediainline_caption_warn',
25
25
  defaultMessage: 'Inline (caption will be removed)',
26
26
  description: 'In the context of media single contains media node, it allows the user to convert media single to media inline image and warn user about caption being removed'
27
27
  }
@@ -1,6 +1,6 @@
1
1
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
2
2
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
3
- const packageVersion = "77.1.1";
3
+ const packageVersion = "77.2.0";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -7,7 +7,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
7
7
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
8
8
  import Layer from '../Layer';
9
9
  const packageName = "@atlaskit/editor-common";
10
- const packageVersion = "77.1.1";
10
+ const packageVersion = "77.2.0";
11
11
  const halfFocusRing = 1;
12
12
  const dropOffset = '0, 8';
13
13
  class DropList extends Component {
@@ -1,6 +1,6 @@
1
1
  export { MediaInlineImageCard } from './media-inline-image-card';
2
- export { shouldShowInlineImage } from './utils';
3
2
  export { InlineImageWrapper } from './inline-image-wrapper';
4
3
  export { DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT } from './constants';
5
4
  export { DEFAULT_INLINE_IMAGE_ASPECT_RATIO } from './constants';
6
- export { mediaInlineImageStyles, INLINE_IMAGE_WRAPPER_CLASS_NAME } from './styles';
5
+ export { mediaInlineImageStyles, INLINE_IMAGE_WRAPPER_CLASS_NAME } from './styles';
6
+ export { mediaInlineImagesEnabled } from './utils';
@@ -1,7 +1,15 @@
1
1
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
2
- export var shouldShowInlineImage = function shouldShowInlineImage(mediaType) {
3
- if (getBooleanFF('platform.editor.media.inline-image.base-support')) {
4
- return mediaType === 'image';
5
- }
6
- return false;
2
+
3
+ /**
4
+ * Enable media inline images feature based on
5
+ * mediaOptions.featureFlags.mediaInline, mediaOptions.allowMediaInlineImages and platform FF platform.editor.media.inline-image.base-support
6
+ *
7
+ * The reason not using mediaOption as param is because MediaOption is from editor-plugin-media
8
+ * we want to avoid circular deps
9
+ * @param allowMediaInline MediaOptions.featureFlags.mediaInline
10
+ * @param allowMediaInlineImages MediaOptions.allowMediaInlineImages
11
+ * @returns boolean
12
+ */
13
+ export var mediaInlineImagesEnabled = function mediaInlineImagesEnabled(allowMediaInline, allowMediaInlineImages) {
14
+ return allowMediaInline && allowMediaInlineImages && getBooleanFF('platform.editor.media.inline-image.base-support');
7
15
  };
@@ -85,6 +85,11 @@ export var messages = defineMessages({
85
85
  defaultMessage: 'Edit search query',
86
86
  description: 'Tooltip of button to edit a card into a datasource'
87
87
  },
88
+ datasourceAppearanceTitle: {
89
+ id: 'fabric.editor.datasourceAppearanceTitle',
90
+ defaultMessage: 'Table',
91
+ description: 'Tooltip of button to change to datasource table appearance'
92
+ },
88
93
  datasourceJiraIssue: {
89
94
  id: 'fabric.editor.datasource.jiraIssue',
90
95
  defaultMessage: 'Jira Issues',
@@ -16,12 +16,12 @@ export var toolbarMessages = defineMessages({
16
16
  description: 'In the context of a media inline image, it allows the user to convert it to media single'
17
17
  },
18
18
  changeToMediaInlineImage: {
19
- id: 'fabric.editor.media_change_mediainline',
19
+ id: 'fabric.editor.media_change_mediainline_default',
20
20
  defaultMessage: 'Inline',
21
21
  description: 'In the context of media single contains media node, it allows the user to convert media single to media inline image'
22
22
  },
23
- changeToMediaInlineImageCaptionWanrning: {
24
- id: 'fabric.editor.media_change_mediainline',
23
+ changeToMediaInlineImageCaptionWarning: {
24
+ id: 'fabric.editor.media_change_mediainline_caption_warn',
25
25
  defaultMessage: 'Inline (caption will be removed)',
26
26
  description: 'In the context of media single contains media node, it allows the user to convert media single to media inline image and warn user about caption being removed'
27
27
  }
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
7
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
8
8
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
9
- var packageVersion = "77.1.1";
9
+ var packageVersion = "77.2.0";
10
10
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
11
11
  // Remove URL as it has UGC
12
12
  // TODO: Sanitise the URL instead of just removing it
@@ -17,7 +17,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
17
17
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
18
18
  import Layer from '../Layer';
19
19
  var packageName = "@atlaskit/editor-common";
20
- var packageVersion = "77.1.1";
20
+ var packageVersion = "77.2.0";
21
21
  var halfFocusRing = 1;
22
22
  var dropOffset = '0, 8';
23
23
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1,7 +1,7 @@
1
1
  export { MediaInlineImageCard } from './media-inline-image-card';
2
- export { shouldShowInlineImage } from './utils';
3
2
  export { InlineImageWrapper } from './inline-image-wrapper';
4
3
  export { DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT } from './constants';
5
4
  export type { MediaInlineAttrs } from './types';
6
5
  export { DEFAULT_INLINE_IMAGE_ASPECT_RATIO } from './constants';
7
6
  export { mediaInlineImageStyles, INLINE_IMAGE_WRAPPER_CLASS_NAME, } from './styles';
7
+ export { mediaInlineImagesEnabled } from './utils';
@@ -1 +1,11 @@
1
- export declare const shouldShowInlineImage: (mediaType: string) => boolean;
1
+ /**
2
+ * Enable media inline images feature based on
3
+ * mediaOptions.featureFlags.mediaInline, mediaOptions.allowMediaInlineImages and platform FF platform.editor.media.inline-image.base-support
4
+ *
5
+ * The reason not using mediaOption as param is because MediaOption is from editor-plugin-media
6
+ * we want to avoid circular deps
7
+ * @param allowMediaInline MediaOptions.featureFlags.mediaInline
8
+ * @param allowMediaInlineImages MediaOptions.allowMediaInlineImages
9
+ * @returns boolean
10
+ */
11
+ export declare const mediaInlineImagesEnabled: (allowMediaInline?: boolean, allowMediaInlineImages?: boolean) => boolean | undefined;
@@ -84,6 +84,11 @@ export declare const messages: {
84
84
  defaultMessage: string;
85
85
  description: string;
86
86
  };
87
+ datasourceAppearanceTitle: {
88
+ id: string;
89
+ defaultMessage: string;
90
+ description: string;
91
+ };
87
92
  datasourceJiraIssue: {
88
93
  id: string;
89
94
  defaultMessage: string;
@@ -19,7 +19,7 @@ export declare const toolbarMessages: {
19
19
  defaultMessage: string;
20
20
  description: string;
21
21
  };
22
- changeToMediaInlineImageCaptionWanrning: {
22
+ changeToMediaInlineImageCaptionWarning: {
23
23
  id: string;
24
24
  defaultMessage: string;
25
25
  description: string;
@@ -1,7 +1,7 @@
1
1
  export { MediaInlineImageCard } from './media-inline-image-card';
2
- export { shouldShowInlineImage } from './utils';
3
2
  export { InlineImageWrapper } from './inline-image-wrapper';
4
3
  export { DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT } from './constants';
5
4
  export type { MediaInlineAttrs } from './types';
6
5
  export { DEFAULT_INLINE_IMAGE_ASPECT_RATIO } from './constants';
7
6
  export { mediaInlineImageStyles, INLINE_IMAGE_WRAPPER_CLASS_NAME, } from './styles';
7
+ export { mediaInlineImagesEnabled } from './utils';
@@ -1 +1,11 @@
1
- export declare const shouldShowInlineImage: (mediaType: string) => boolean;
1
+ /**
2
+ * Enable media inline images feature based on
3
+ * mediaOptions.featureFlags.mediaInline, mediaOptions.allowMediaInlineImages and platform FF platform.editor.media.inline-image.base-support
4
+ *
5
+ * The reason not using mediaOption as param is because MediaOption is from editor-plugin-media
6
+ * we want to avoid circular deps
7
+ * @param allowMediaInline MediaOptions.featureFlags.mediaInline
8
+ * @param allowMediaInlineImages MediaOptions.allowMediaInlineImages
9
+ * @returns boolean
10
+ */
11
+ export declare const mediaInlineImagesEnabled: (allowMediaInline?: boolean, allowMediaInlineImages?: boolean) => boolean | undefined;
@@ -84,6 +84,11 @@ export declare const messages: {
84
84
  defaultMessage: string;
85
85
  description: string;
86
86
  };
87
+ datasourceAppearanceTitle: {
88
+ id: string;
89
+ defaultMessage: string;
90
+ description: string;
91
+ };
87
92
  datasourceJiraIssue: {
88
93
  id: string;
89
94
  defaultMessage: string;
@@ -19,7 +19,7 @@ export declare const toolbarMessages: {
19
19
  defaultMessage: string;
20
20
  description: string;
21
21
  };
22
- changeToMediaInlineImageCaptionWanrning: {
22
+ changeToMediaInlineImageCaptionWarning: {
23
23
  id: string;
24
24
  defaultMessage: string;
25
25
  description: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "77.1.1",
3
+ "version": "77.2.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -97,7 +97,7 @@
97
97
  "@atlaskit/analytics-namespaced-context": "^6.9.0",
98
98
  "@atlaskit/analytics-next": "^9.1.0",
99
99
  "@atlaskit/analytics-next-stable-react-context": "1.0.1",
100
- "@atlaskit/button": "^17.2.0",
100
+ "@atlaskit/button": "^17.3.0",
101
101
  "@atlaskit/code": "^15.1.0",
102
102
  "@atlaskit/codemod-utils": "^4.2.0",
103
103
  "@atlaskit/custom-steps": "^0.0.11",
@@ -110,7 +110,7 @@
110
110
  "@atlaskit/icon": "^22.0.0",
111
111
  "@atlaskit/icon-object": "^6.3.0",
112
112
  "@atlaskit/in-product-testing": "^0.2.0",
113
- "@atlaskit/link-datasource": "^1.19.0",
113
+ "@atlaskit/link-datasource": "^1.22.0",
114
114
  "@atlaskit/link-picker": "^1.33.0",
115
115
  "@atlaskit/media-card": "^77.7.0",
116
116
  "@atlaskit/media-client": "^26.1.0",