@atlaskit/editor-plugin-media-insert 24.0.0 → 24.0.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-plugin-media-insert
2
2
 
3
+ ## 24.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`883d14f6d3052`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/883d14f6d3052) -
8
+ [EDITOR-7439] [M0] Update `upload` tab copy
9
+ - Updated dependencies
10
+
3
11
  ## 24.0.0
4
12
 
5
13
  ### Patch Changes
@@ -18,6 +18,7 @@ var _upload = _interopRequireDefault(require("@atlaskit/icon/core/upload"));
18
18
  var _mediaPicker = require("@atlaskit/media-picker");
19
19
  var _compiled = require("@atlaskit/primitives/compiled");
20
20
  var _sectionMessage = _interopRequireDefault(require("@atlaskit/section-message"));
21
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
21
22
  var _useAnalyticsEvents2 = require("./useAnalyticsEvents");
22
23
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
23
24
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -58,6 +59,7 @@ var LocalMedia = exports.LocalMedia = /*#__PURE__*/_react.default.forwardRef(fun
58
59
  var intl = (0, _reactIntl.useIntl)();
59
60
  var strings = {
60
61
  upload: intl.formatMessage(_messages.mediaInsertMessages.upload),
62
+ chooseFile: intl.formatMessage(_messages.mediaInsertMessages.chooseFile),
61
63
  networkError: intl.formatMessage(_messages.mediaInsertMessages.localFileNetworkErrorMessage),
62
64
  genericError: intl.formatMessage(_messages.mediaInsertMessages.localFileErrorMessage)
63
65
  };
@@ -154,6 +156,7 @@ var LocalMedia = exports.LocalMedia = /*#__PURE__*/_react.default.forwardRef(fun
154
156
  });
155
157
  (_eventSubscribers$cur6 = eventSubscribers.current) === null || _eventSubscribers$cur6 === void 0 || delete _eventSubscribers$cur6[fileId];
156
158
  }, [erroredFileIds, onUploadFailureAnalytics]);
159
+ var buttonText = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('cc_page_experiences_editor_image_generation', 'isEnabled', true) ? strings.chooseFile : strings.upload;
157
160
  return /*#__PURE__*/_react.default.createElement(_compiled.Stack, {
158
161
  grow: "fill",
159
162
  space: "space.200"
@@ -179,7 +182,7 @@ var LocalMedia = exports.LocalMedia = /*#__PURE__*/_react.default.forwardRef(fun
179
182
  type: 'open'
180
183
  });
181
184
  }
182
- }, strings.upload), uploadMediaClientConfig && uploadParams && /*#__PURE__*/_react.default.createElement(_mediaPicker.Browser, {
185
+ }, buttonText), uploadMediaClientConfig && uploadParams && /*#__PURE__*/_react.default.createElement(_mediaPicker.Browser, {
183
186
  isOpen: uploadState.isOpen
184
187
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
185
188
  ,
@@ -17,6 +17,7 @@ var _ui = require("@atlaskit/editor-common/ui");
17
17
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
18
18
  var _compiled = require("@atlaskit/primitives/compiled");
19
19
  var _tabs = _interopRequireWildcard(require("@atlaskit/tabs"));
20
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
20
21
  var _useFocusEditor = require("./hooks/use-focus-editor");
21
22
  var _useUnholyAutofocus2 = require("./hooks/use-unholy-autofocus");
22
23
  var _LocalMedia = require("./LocalMedia");
@@ -117,6 +118,7 @@ var MediaInsertPicker = exports.MediaInsertPicker = function MediaInsertPicker(_
117
118
  focusEditor();
118
119
  };
119
120
  };
121
+ var fileTabTitle = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('cc_page_experiences_editor_image_generation', 'isEnabled', true) ? intl.formatMessage(_messages.mediaInsertMessages.uploadTabTitle) : intl.formatMessage(_messages.mediaInsertMessages.fileTabTitle);
120
122
  return /*#__PURE__*/_react.default.createElement(PopupWithListeners, {
121
123
  ariaLabel: intl.formatMessage(_messages.mediaInsertMessages.mediaPickerPopupAriaLabel)
122
124
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
@@ -145,7 +147,7 @@ var MediaInsertPicker = exports.MediaInsertPicker = function MediaInsertPicker(_
145
147
  return /*#__PURE__*/_react.default.createElement(_tabs.Tab, {
146
148
  key: tab.key
147
149
  }, tab.label);
148
- }), !isOnlyExternalLinks && /*#__PURE__*/_react.default.createElement(_tabs.Tab, null, intl.formatMessage(_messages.mediaInsertMessages.fileTabTitle)), /*#__PURE__*/_react.default.createElement(_tabs.Tab, null, intl.formatMessage(_messages.mediaInsertMessages.linkTabTitle)))), registeredTabs.map(function (_ref3) {
150
+ }), !isOnlyExternalLinks && /*#__PURE__*/_react.default.createElement(_tabs.Tab, null, fileTabTitle), /*#__PURE__*/_react.default.createElement(_tabs.Tab, null, intl.formatMessage(_messages.mediaInsertMessages.linkTabTitle)))), registeredTabs.map(function (_ref3) {
149
151
  var key = _ref3.key,
150
152
  TabComponent = _ref3.component;
151
153
  return /*#__PURE__*/_react.default.createElement(CustomTabPanel, {
@@ -7,6 +7,7 @@ import UploadIcon from '@atlaskit/icon/core/upload';
7
7
  import { Browser } from '@atlaskit/media-picker';
8
8
  import { Stack } from '@atlaskit/primitives/compiled';
9
9
  import SectionMessage from '@atlaskit/section-message';
10
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
10
11
  import { useAnalyticsEvents } from './useAnalyticsEvents';
11
12
  const INITIAL_UPLOAD_STATE = Object.freeze({
12
13
  isOpen: false,
@@ -48,6 +49,7 @@ export const LocalMedia = /*#__PURE__*/React.forwardRef(({
48
49
  const intl = useIntl();
49
50
  const strings = {
50
51
  upload: intl.formatMessage(mediaInsertMessages.upload),
52
+ chooseFile: intl.formatMessage(mediaInsertMessages.chooseFile),
51
53
  networkError: intl.formatMessage(mediaInsertMessages.localFileNetworkErrorMessage),
52
54
  genericError: intl.formatMessage(mediaInsertMessages.localFileErrorMessage)
53
55
  };
@@ -144,6 +146,7 @@ export const LocalMedia = /*#__PURE__*/React.forwardRef(({
144
146
  }));
145
147
  (_eventSubscribers$cur8 = eventSubscribers.current) === null || _eventSubscribers$cur8 === void 0 ? true : delete _eventSubscribers$cur8[fileId];
146
148
  }, [erroredFileIds, onUploadFailureAnalytics]);
149
+ const buttonText = expValEqualsNoExposure('cc_page_experiences_editor_image_generation', 'isEnabled', true) ? strings.chooseFile : strings.upload;
147
150
  return /*#__PURE__*/React.createElement(Stack, {
148
151
  grow: "fill",
149
152
  space: "space.200"
@@ -167,7 +170,7 @@ export const LocalMedia = /*#__PURE__*/React.forwardRef(({
167
170
  type: 'open'
168
171
  });
169
172
  }
170
- }, strings.upload), uploadMediaClientConfig && uploadParams && /*#__PURE__*/React.createElement(Browser, {
173
+ }, buttonText), uploadMediaClientConfig && uploadParams && /*#__PURE__*/React.createElement(Browser, {
171
174
  isOpen: uploadState.isOpen
172
175
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
173
176
  ,
@@ -9,6 +9,7 @@ import { PlainOutsideClickTargetRefContext, Popup, withOuterListeners } from '@a
9
9
  import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
10
10
  import { Box } from '@atlaskit/primitives/compiled';
11
11
  import Tabs, { Tab, TabList, useTabPanel } from '@atlaskit/tabs';
12
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
12
13
  import { useFocusEditor } from './hooks/use-focus-editor';
13
14
  import { useUnholyAutofocus } from './hooks/use-unholy-autofocus';
14
15
  import { LocalMedia } from './LocalMedia';
@@ -108,6 +109,7 @@ export const MediaInsertPicker = ({
108
109
  closeMediaInsertPicker();
109
110
  focusEditor();
110
111
  };
112
+ const fileTabTitle = expValEqualsNoExposure('cc_page_experiences_editor_image_generation', 'isEnabled', true) ? intl.formatMessage(mediaInsertMessages.uploadTabTitle) : intl.formatMessage(mediaInsertMessages.fileTabTitle);
111
113
  return /*#__PURE__*/React.createElement(PopupWithListeners, {
112
114
  ariaLabel: intl.formatMessage(mediaInsertMessages.mediaPickerPopupAriaLabel)
113
115
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
@@ -133,7 +135,7 @@ export const MediaInsertPicker = ({
133
135
  paddingBlockEnd: "space.150"
134
136
  }, /*#__PURE__*/React.createElement(TabList, null, registeredTabs.map(tab => /*#__PURE__*/React.createElement(Tab, {
135
137
  key: tab.key
136
- }, tab.label)), !isOnlyExternalLinks && /*#__PURE__*/React.createElement(Tab, null, intl.formatMessage(mediaInsertMessages.fileTabTitle)), /*#__PURE__*/React.createElement(Tab, null, intl.formatMessage(mediaInsertMessages.linkTabTitle)))), registeredTabs.map(({
138
+ }, tab.label)), !isOnlyExternalLinks && /*#__PURE__*/React.createElement(Tab, null, fileTabTitle), /*#__PURE__*/React.createElement(Tab, null, intl.formatMessage(mediaInsertMessages.linkTabTitle)))), registeredTabs.map(({
137
139
  key,
138
140
  component: TabComponent
139
141
  }) => /*#__PURE__*/React.createElement(CustomTabPanel, {
@@ -12,6 +12,7 @@ import UploadIcon from '@atlaskit/icon/core/upload';
12
12
  import { Browser } from '@atlaskit/media-picker';
13
13
  import { Stack } from '@atlaskit/primitives/compiled';
14
14
  import SectionMessage from '@atlaskit/section-message';
15
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
15
16
  import { useAnalyticsEvents } from './useAnalyticsEvents';
16
17
  var INITIAL_UPLOAD_STATE = Object.freeze({
17
18
  isOpen: false,
@@ -49,6 +50,7 @@ export var LocalMedia = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
49
50
  var intl = useIntl();
50
51
  var strings = {
51
52
  upload: intl.formatMessage(mediaInsertMessages.upload),
53
+ chooseFile: intl.formatMessage(mediaInsertMessages.chooseFile),
52
54
  networkError: intl.formatMessage(mediaInsertMessages.localFileNetworkErrorMessage),
53
55
  genericError: intl.formatMessage(mediaInsertMessages.localFileErrorMessage)
54
56
  };
@@ -145,6 +147,7 @@ export var LocalMedia = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
145
147
  });
146
148
  (_eventSubscribers$cur6 = eventSubscribers.current) === null || _eventSubscribers$cur6 === void 0 || delete _eventSubscribers$cur6[fileId];
147
149
  }, [erroredFileIds, onUploadFailureAnalytics]);
150
+ var buttonText = expValEqualsNoExposure('cc_page_experiences_editor_image_generation', 'isEnabled', true) ? strings.chooseFile : strings.upload;
148
151
  return /*#__PURE__*/React.createElement(Stack, {
149
152
  grow: "fill",
150
153
  space: "space.200"
@@ -170,7 +173,7 @@ export var LocalMedia = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
170
173
  type: 'open'
171
174
  });
172
175
  }
173
- }, strings.upload), uploadMediaClientConfig && uploadParams && /*#__PURE__*/React.createElement(Browser, {
176
+ }, buttonText), uploadMediaClientConfig && uploadParams && /*#__PURE__*/React.createElement(Browser, {
174
177
  isOpen: uploadState.isOpen
175
178
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
176
179
  ,
@@ -9,6 +9,7 @@ import { PlainOutsideClickTargetRefContext, Popup, withOuterListeners } from '@a
9
9
  import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
10
10
  import { Box } from '@atlaskit/primitives/compiled';
11
11
  import Tabs, { Tab, TabList, useTabPanel } from '@atlaskit/tabs';
12
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
12
13
  import { useFocusEditor } from './hooks/use-focus-editor';
13
14
  import { useUnholyAutofocus } from './hooks/use-unholy-autofocus';
14
15
  import { LocalMedia } from './LocalMedia';
@@ -108,6 +109,7 @@ export var MediaInsertPicker = function MediaInsertPicker(_ref2) {
108
109
  focusEditor();
109
110
  };
110
111
  };
112
+ var fileTabTitle = expValEqualsNoExposure('cc_page_experiences_editor_image_generation', 'isEnabled', true) ? intl.formatMessage(mediaInsertMessages.uploadTabTitle) : intl.formatMessage(mediaInsertMessages.fileTabTitle);
111
113
  return /*#__PURE__*/React.createElement(PopupWithListeners, {
112
114
  ariaLabel: intl.formatMessage(mediaInsertMessages.mediaPickerPopupAriaLabel)
113
115
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
@@ -136,7 +138,7 @@ export var MediaInsertPicker = function MediaInsertPicker(_ref2) {
136
138
  return /*#__PURE__*/React.createElement(Tab, {
137
139
  key: tab.key
138
140
  }, tab.label);
139
- }), !isOnlyExternalLinks && /*#__PURE__*/React.createElement(Tab, null, intl.formatMessage(mediaInsertMessages.fileTabTitle)), /*#__PURE__*/React.createElement(Tab, null, intl.formatMessage(mediaInsertMessages.linkTabTitle)))), registeredTabs.map(function (_ref3) {
141
+ }), !isOnlyExternalLinks && /*#__PURE__*/React.createElement(Tab, null, fileTabTitle), /*#__PURE__*/React.createElement(Tab, null, intl.formatMessage(mediaInsertMessages.linkTabTitle)))), registeredTabs.map(function (_ref3) {
140
142
  var key = _ref3.key,
141
143
  TabComponent = _ref3.component;
142
144
  return /*#__PURE__*/React.createElement(CustomTabPanel, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media-insert",
3
- "version": "24.0.0",
3
+ "version": "24.0.1",
4
4
  "description": "Media Insert plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -21,14 +21,14 @@
21
21
  ],
22
22
  "atlaskit:src": "src/index.ts",
23
23
  "dependencies": {
24
- "@atlaskit/adf-schema": "^52.15.0",
24
+ "@atlaskit/adf-schema": "^52.16.0",
25
25
  "@atlaskit/button": "^23.11.0",
26
26
  "@atlaskit/editor-plugin-analytics": "^11.0.0",
27
27
  "@atlaskit/editor-plugin-media": "^13.0.0",
28
28
  "@atlaskit/editor-prosemirror": "^7.3.0",
29
29
  "@atlaskit/editor-shared-styles": "^3.11.0",
30
30
  "@atlaskit/form": "^15.5.0",
31
- "@atlaskit/icon": "^35.3.0",
31
+ "@atlaskit/icon": "^35.4.0",
32
32
  "@atlaskit/media-card": "^80.7.0",
33
33
  "@atlaskit/media-client": "^36.3.0",
34
34
  "@atlaskit/media-client-react": "^5.2.0",
@@ -38,6 +38,7 @@
38
38
  "@atlaskit/section-message": "^8.13.0",
39
39
  "@atlaskit/tabs": "^19.1.0",
40
40
  "@atlaskit/textfield": "^8.3.0",
41
+ "@atlaskit/tmp-editor-statsig": "^88.4.0",
41
42
  "@babel/runtime": "^7.0.0"
42
43
  },
43
44
  "peerDependencies": {