@atlaskit/editor-plugin-media 10.1.13 → 10.2.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,22 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 10.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 10.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`3778325d7b086`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3778325d7b086) -
14
+ Fix save button disable in editor
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 10.1.13
4
21
 
5
22
  ### Patch Changes
@@ -182,11 +182,27 @@ var MediaPluginStateImplementation = exports.MediaPluginStateImplementation = /*
182
182
  }
183
183
  });
184
184
  });
185
- _this.taskManager.addPendingTask(uploadingPromise, mediaStateWithContext.id).then(function () {
186
- _this.updateAndDispatch({
187
- allUploadsFinished: true
185
+ if ((0, _platformFeatureFlags.fg)('platform_editor_media_disable_save_during_upload')) {
186
+ _this.taskManager.addPendingTask(uploadingPromise, mediaStateWithContext.id).then(function () {
187
+ _this.updateAndDispatch({
188
+ allUploadsFinished: true
189
+ });
190
+ _this.waitForPendingTasks().then(function () {
191
+ if (_this.uploadInProgressSubscriptions.length > 0 && _this.uploadInProgressSubscriptionsNotified) {
192
+ _this.uploadInProgressSubscriptions.forEach(function (fn) {
193
+ return fn(false);
194
+ });
195
+ _this.uploadInProgressSubscriptionsNotified = false;
196
+ }
197
+ });
188
198
  });
189
- });
199
+ } else {
200
+ _this.taskManager.addPendingTask(uploadingPromise, mediaStateWithContext.id).then(function () {
201
+ _this.updateAndDispatch({
202
+ allUploadsFinished: true
203
+ });
204
+ });
205
+ }
190
206
  }
191
207
 
192
208
  // refocus the view
@@ -194,14 +210,16 @@ var MediaPluginStateImplementation = exports.MediaPluginStateImplementation = /*
194
210
  if (!view.hasFocus()) {
195
211
  view.focus();
196
212
  }
197
- _this.waitForPendingTasks().then(function () {
198
- if (_this.uploadInProgressSubscriptions.length > 0 && _this.uploadInProgressSubscriptionsNotified) {
199
- _this.uploadInProgressSubscriptions.forEach(function (fn) {
200
- return fn(false);
201
- });
202
- _this.uploadInProgressSubscriptionsNotified = false;
203
- }
204
- });
213
+ if (isEndState(mediaStateWithContext) || !(0, _platformFeatureFlags.fg)('platform_editor_media_disable_save_during_upload')) {
214
+ _this.waitForPendingTasks().then(function () {
215
+ if (_this.uploadInProgressSubscriptions.length > 0 && _this.uploadInProgressSubscriptionsNotified) {
216
+ _this.uploadInProgressSubscriptions.forEach(function (fn) {
217
+ return fn(false);
218
+ });
219
+ _this.uploadInProgressSubscriptionsNotified = false;
220
+ }
221
+ });
222
+ }
205
223
  _this.selectLastAddedMediaNode();
206
224
  });
207
225
  // Ignored via go/ees005
@@ -158,11 +158,25 @@ export class MediaPluginStateImplementation {
158
158
  }
159
159
  });
160
160
  });
161
- this.taskManager.addPendingTask(uploadingPromise, mediaStateWithContext.id).then(() => {
162
- this.updateAndDispatch({
163
- allUploadsFinished: true
161
+ if (fg('platform_editor_media_disable_save_during_upload')) {
162
+ this.taskManager.addPendingTask(uploadingPromise, mediaStateWithContext.id).then(() => {
163
+ this.updateAndDispatch({
164
+ allUploadsFinished: true
165
+ });
166
+ this.waitForPendingTasks().then(() => {
167
+ if (this.uploadInProgressSubscriptions.length > 0 && this.uploadInProgressSubscriptionsNotified) {
168
+ this.uploadInProgressSubscriptions.forEach(fn => fn(false));
169
+ this.uploadInProgressSubscriptionsNotified = false;
170
+ }
171
+ });
164
172
  });
165
- });
173
+ } else {
174
+ this.taskManager.addPendingTask(uploadingPromise, mediaStateWithContext.id).then(() => {
175
+ this.updateAndDispatch({
176
+ allUploadsFinished: true
177
+ });
178
+ });
179
+ }
166
180
  }
167
181
 
168
182
  // refocus the view
@@ -172,12 +186,14 @@ export class MediaPluginStateImplementation {
172
186
  if (!view.hasFocus()) {
173
187
  view.focus();
174
188
  }
175
- this.waitForPendingTasks().then(() => {
176
- if (this.uploadInProgressSubscriptions.length > 0 && this.uploadInProgressSubscriptionsNotified) {
177
- this.uploadInProgressSubscriptions.forEach(fn => fn(false));
178
- this.uploadInProgressSubscriptionsNotified = false;
179
- }
180
- });
189
+ if (isEndState(mediaStateWithContext) || !fg('platform_editor_media_disable_save_during_upload')) {
190
+ this.waitForPendingTasks().then(() => {
191
+ if (this.uploadInProgressSubscriptions.length > 0 && this.uploadInProgressSubscriptionsNotified) {
192
+ this.uploadInProgressSubscriptions.forEach(fn => fn(false));
193
+ this.uploadInProgressSubscriptionsNotified = false;
194
+ }
195
+ });
196
+ }
181
197
  this.selectLastAddedMediaNode();
182
198
  });
183
199
  // Ignored via go/ees005
@@ -174,11 +174,27 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
174
174
  }
175
175
  });
176
176
  });
177
- _this.taskManager.addPendingTask(uploadingPromise, mediaStateWithContext.id).then(function () {
178
- _this.updateAndDispatch({
179
- allUploadsFinished: true
177
+ if (fg('platform_editor_media_disable_save_during_upload')) {
178
+ _this.taskManager.addPendingTask(uploadingPromise, mediaStateWithContext.id).then(function () {
179
+ _this.updateAndDispatch({
180
+ allUploadsFinished: true
181
+ });
182
+ _this.waitForPendingTasks().then(function () {
183
+ if (_this.uploadInProgressSubscriptions.length > 0 && _this.uploadInProgressSubscriptionsNotified) {
184
+ _this.uploadInProgressSubscriptions.forEach(function (fn) {
185
+ return fn(false);
186
+ });
187
+ _this.uploadInProgressSubscriptionsNotified = false;
188
+ }
189
+ });
180
190
  });
181
- });
191
+ } else {
192
+ _this.taskManager.addPendingTask(uploadingPromise, mediaStateWithContext.id).then(function () {
193
+ _this.updateAndDispatch({
194
+ allUploadsFinished: true
195
+ });
196
+ });
197
+ }
182
198
  }
183
199
 
184
200
  // refocus the view
@@ -186,14 +202,16 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
186
202
  if (!view.hasFocus()) {
187
203
  view.focus();
188
204
  }
189
- _this.waitForPendingTasks().then(function () {
190
- if (_this.uploadInProgressSubscriptions.length > 0 && _this.uploadInProgressSubscriptionsNotified) {
191
- _this.uploadInProgressSubscriptions.forEach(function (fn) {
192
- return fn(false);
193
- });
194
- _this.uploadInProgressSubscriptionsNotified = false;
195
- }
196
- });
205
+ if (isEndState(mediaStateWithContext) || !fg('platform_editor_media_disable_save_during_upload')) {
206
+ _this.waitForPendingTasks().then(function () {
207
+ if (_this.uploadInProgressSubscriptions.length > 0 && _this.uploadInProgressSubscriptionsNotified) {
208
+ _this.uploadInProgressSubscriptions.forEach(function (fn) {
209
+ return fn(false);
210
+ });
211
+ _this.uploadInProgressSubscriptionsNotified = false;
212
+ }
213
+ });
214
+ }
197
215
  _this.selectLastAddedMediaNode();
198
216
  });
199
217
  // Ignored via go/ees005
@@ -23,9 +23,9 @@ export declare class AltTextEditComponent extends React.Component<Props, AltText
23
23
  private fireCustomAnalytics?;
24
24
  private errorsListRef;
25
25
  state: {
26
+ lastValue: string | undefined;
26
27
  showClearTextButton: boolean;
27
28
  validationErrors: string[];
28
- lastValue: string | undefined;
29
29
  };
30
30
  constructor(props: Props);
31
31
  prevValue: string | undefined;
@@ -23,9 +23,9 @@ export declare class AltTextEditComponent extends React.Component<Props, AltText
23
23
  private fireCustomAnalytics?;
24
24
  private errorsListRef;
25
25
  state: {
26
+ lastValue: string | undefined;
26
27
  showClearTextButton: boolean;
27
28
  validationErrors: string[];
28
- lastValue: string | undefined;
29
29
  };
30
30
  constructor(props: Props);
31
31
  prevValue: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "10.1.13",
3
+ "version": "10.2.1",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  "@atlaskit/adf-schema": "^52.4.0",
33
33
  "@atlaskit/analytics-namespaced-context": "^7.2.0",
34
34
  "@atlaskit/analytics-next": "^11.2.0",
35
- "@atlaskit/button": "^23.10.0",
35
+ "@atlaskit/button": "^23.11.0",
36
36
  "@atlaskit/editor-palette": "^2.1.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^8.0.0",
38
38
  "@atlaskit/editor-plugin-annotation": "^8.0.0",
@@ -53,7 +53,7 @@
53
53
  "@atlaskit/editor-tables": "^2.9.0",
54
54
  "@atlaskit/form": "^15.5.0",
55
55
  "@atlaskit/icon": "^34.0.0",
56
- "@atlaskit/icon-lab": "^6.2.0",
56
+ "@atlaskit/icon-lab": "^6.4.0",
57
57
  "@atlaskit/media-card": "^79.16.0",
58
58
  "@atlaskit/media-client": "^36.0.0",
59
59
  "@atlaskit/media-client-react": "^5.0.0",
@@ -64,9 +64,9 @@
64
64
  "@atlaskit/media-viewer": "^52.9.0",
65
65
  "@atlaskit/platform-feature-flags": "^1.1.0",
66
66
  "@atlaskit/primitives": "^18.1.0",
67
- "@atlaskit/textfield": "^8.2.0",
67
+ "@atlaskit/textfield": "^8.3.0",
68
68
  "@atlaskit/theme": "^22.0.0",
69
- "@atlaskit/tmp-editor-statsig": "^54.0.0",
69
+ "@atlaskit/tmp-editor-statsig": "^55.0.0",
70
70
  "@atlaskit/tokens": "^11.4.0",
71
71
  "@atlaskit/tooltip": "^21.1.0",
72
72
  "@babel/runtime": "^7.0.0",
@@ -78,7 +78,7 @@
78
78
  "uuid": "^3.1.0"
79
79
  },
80
80
  "peerDependencies": {
81
- "@atlaskit/editor-common": "^112.16.0",
81
+ "@atlaskit/editor-common": "^112.18.0",
82
82
  "@atlaskit/media-core": "^37.0.0",
83
83
  "react": "^18.2.0",
84
84
  "react-dom": "^18.2.0",
@@ -165,6 +165,9 @@
165
165
  },
166
166
  "platform_editor_media_border_radius_fix": {
167
167
  "type": "boolean"
168
+ },
169
+ "platform_editor_media_disable_save_during_upload": {
170
+ "type": "boolean"
168
171
  }
169
172
  },
170
173
  "stricter": {