@atlaskit/editor-plugin-media 12.8.2 → 12.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/nodeviews/mediaGroupNext.js +12 -12
  3. package/dist/cjs/nodeviews/mediaInline.js +25 -25
  4. package/dist/cjs/nodeviews/mediaNodeUpdater.js +199 -198
  5. package/dist/cjs/nodeviews/mediaNodeView/media.js +29 -17
  6. package/dist/cjs/nodeviews/mediaSingleNext.js +24 -24
  7. package/dist/cjs/pm-plugins/ai-generating-decoration.js +59 -12
  8. package/dist/cjs/pm-plugins/commands.js +2 -2
  9. package/dist/cjs/pm-plugins/main.js +55 -46
  10. package/dist/cjs/pm-plugins/mediaTaskManager.js +6 -6
  11. package/dist/cjs/pm-plugins/picker-facade.js +4 -4
  12. package/dist/cjs/pm-plugins/utils/check-media-type.js +17 -17
  13. package/dist/cjs/ui/MediaPicker/PickerFacadeProvider.js +21 -21
  14. package/dist/cjs/ui/ResizableMediaSingle/index.js +18 -18
  15. package/dist/cjs/ui/toolbar/utils.js +11 -11
  16. package/dist/es2019/nodeviews/mediaNodeView/media.js +12 -0
  17. package/dist/es2019/pm-plugins/ai-generating-decoration.js +53 -12
  18. package/dist/es2019/pm-plugins/commands.js +2 -2
  19. package/dist/es2019/pm-plugins/main.js +11 -1
  20. package/dist/esm/nodeviews/mediaGroupNext.js +12 -12
  21. package/dist/esm/nodeviews/mediaInline.js +25 -25
  22. package/dist/esm/nodeviews/mediaNodeUpdater.js +199 -198
  23. package/dist/esm/nodeviews/mediaNodeView/media.js +28 -16
  24. package/dist/esm/nodeviews/mediaSingleNext.js +23 -23
  25. package/dist/esm/pm-plugins/ai-generating-decoration.js +59 -12
  26. package/dist/esm/pm-plugins/commands.js +2 -2
  27. package/dist/esm/pm-plugins/main.js +54 -45
  28. package/dist/esm/pm-plugins/mediaTaskManager.js +6 -6
  29. package/dist/esm/pm-plugins/picker-facade.js +4 -4
  30. package/dist/esm/pm-plugins/utils/check-media-type.js +17 -17
  31. package/dist/esm/ui/MediaPicker/PickerFacadeProvider.js +21 -21
  32. package/dist/esm/ui/ResizableMediaSingle/index.js +18 -18
  33. package/dist/esm/ui/toolbar/utils.js +11 -11
  34. package/dist/types/mediaPluginType.d.ts +2 -1
  35. package/dist/types/nodeviews/mediaNodeView/media.d.ts +1 -0
  36. package/dist/types/pm-plugins/ai-generating-decoration.d.ts +3 -1
  37. package/dist/types/pm-plugins/commands.d.ts +2 -1
  38. package/dist/types/pm-plugins/main.d.ts +1 -0
  39. package/dist/types/pm-plugins/types.d.ts +1 -0
  40. package/dist/types-ts4.5/mediaPluginType.d.ts +2 -1
  41. package/dist/types-ts4.5/nodeviews/mediaNodeView/media.d.ts +1 -0
  42. package/dist/types-ts4.5/pm-plugins/ai-generating-decoration.d.ts +3 -1
  43. package/dist/types-ts4.5/pm-plugins/commands.d.ts +2 -1
  44. package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -0
  45. package/dist/types-ts4.5/pm-plugins/types.d.ts +1 -0
  46. package/package.json +10 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 12.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`330e005b44aa7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/330e005b44aa7) -
8
+ [ux] Adding support for loading state on media nodes during CWR with image gen. We reuse the
9
+ ai-generating-decoration and make gated changes to rebuild logic for this use case. We add
10
+ onPreviewRender callback to media-card to signal when the image has rendered.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 12.8.3
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+
3
22
  ## 12.8.2
4
23
 
5
24
  ### Patch Changes
@@ -130,38 +130,38 @@ var useLatestMediaGroupNode = function useLatestMediaGroupNode(nextMediaNode) {
130
130
  var runMediaNodeUpdate = /*#__PURE__*/function () {
131
131
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref2) {
132
132
  var mediaNodeUpdater, getPos, node, updateAttrs, contextId, shouldNodeBeDeepCopied;
133
- return _regenerator.default.wrap(function _callee$(_context) {
133
+ return _regenerator.default.wrap(function (_context) {
134
134
  while (1) switch (_context.prev = _context.next) {
135
135
  case 0:
136
136
  mediaNodeUpdater = _ref2.mediaNodeUpdater, getPos = _ref2.getPos, node = _ref2.node, updateAttrs = _ref2.updateAttrs;
137
137
  if (!updateAttrs) {
138
- _context.next = 4;
138
+ _context.next = 1;
139
139
  break;
140
140
  }
141
- _context.next = 4;
141
+ _context.next = 1;
142
142
  return mediaNodeUpdater.updateNodeAttrs(getPos);
143
- case 4:
143
+ case 1:
144
144
  contextId = mediaNodeUpdater.getNodeContextId();
145
145
  if (contextId) {
146
- _context.next = 8;
146
+ _context.next = 2;
147
147
  break;
148
148
  }
149
- _context.next = 8;
149
+ _context.next = 2;
150
150
  return mediaNodeUpdater.updateNodeContextId(getPos);
151
- case 8:
152
- _context.next = 10;
151
+ case 2:
152
+ _context.next = 3;
153
153
  return mediaNodeUpdater.shouldNodeBeDeepCopied();
154
- case 10:
154
+ case 3:
155
155
  shouldNodeBeDeepCopied = _context.sent;
156
156
  if (!shouldNodeBeDeepCopied) {
157
- _context.next = 14;
157
+ _context.next = 4;
158
158
  break;
159
159
  }
160
- _context.next = 14;
160
+ _context.next = 4;
161
161
  return mediaNodeUpdater.copyNodeFromPos(getPos, {
162
162
  traceId: node.attrs.__mediaTraceId
163
163
  });
164
- case 14:
164
+ case 4:
165
165
  case "end":
166
166
  return _context.stop();
167
167
  }
@@ -54,56 +54,56 @@ var createMediaNodeUpdater = function createMediaNodeUpdater(props) {
54
54
  */
55
55
  var updateMediaNodeAttributes = /*#__PURE__*/function () {
56
56
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(props, mediaNodeUpdater) {
57
- var addPendingTask, node, contextId, shouldNodeBeDeepCopied, copyNode;
58
- return _regenerator.default.wrap(function _callee$(_context) {
57
+ var addPendingTask, node, contextId, shouldNodeBeDeepCopied, copyNode, _t;
58
+ return _regenerator.default.wrap(function (_context) {
59
59
  while (1) switch (_context.prev = _context.next) {
60
60
  case 0:
61
61
  addPendingTask = props.addPendingTask;
62
62
  node = props.node;
63
63
  if (node) {
64
- _context.next = 4;
64
+ _context.next = 1;
65
65
  break;
66
66
  }
67
67
  return _context.abrupt("return");
68
- case 4:
68
+ case 1:
69
69
  contextId = mediaNodeUpdater.getNodeContextId();
70
70
  if (contextId) {
71
- _context.next = 8;
71
+ _context.next = 2;
72
72
  break;
73
73
  }
74
- _context.next = 8;
74
+ _context.next = 2;
75
75
  return mediaNodeUpdater.updateContextId();
76
- case 8:
77
- _context.next = 10;
76
+ case 2:
77
+ _context.next = 3;
78
78
  return mediaNodeUpdater.shouldNodeBeDeepCopied();
79
- case 10:
79
+ case 3:
80
80
  shouldNodeBeDeepCopied = _context.sent;
81
81
  if (!shouldNodeBeDeepCopied) {
82
- _context.next = 22;
82
+ _context.next = 7;
83
83
  break;
84
84
  }
85
- _context.prev = 12;
85
+ _context.prev = 4;
86
86
  copyNode = mediaNodeUpdater.copyNode({
87
87
  traceId: node.attrs.__mediaTraceId
88
88
  });
89
89
  addPendingTask(copyNode);
90
- _context.next = 17;
90
+ _context.next = 5;
91
91
  return copyNode;
92
- case 17:
93
- _context.next = 22;
92
+ case 5:
93
+ _context.next = 7;
94
94
  break;
95
- case 19:
96
- _context.prev = 19;
97
- _context.t0 = _context["catch"](12);
95
+ case 6:
96
+ _context.prev = 6;
97
+ _t = _context["catch"](4);
98
98
  return _context.abrupt("return");
99
- case 22:
100
- _context.next = 24;
99
+ case 7:
100
+ _context.next = 8;
101
101
  return mediaNodeUpdater.updateMediaSingleFileAttrs();
102
- case 24:
102
+ case 8:
103
103
  case "end":
104
104
  return _context.stop();
105
105
  }
106
- }, _callee, null, [[12, 19]]);
106
+ }, _callee, null, [[4, 6]]);
107
107
  }));
108
108
  return function updateMediaNodeAttributes(_x, _x2) {
109
109
  return _ref.apply(this, arguments);
@@ -141,18 +141,18 @@ var MediaInline = exports.MediaInline = function MediaInline(props) {
141
141
  var updateViewMediaClientConfig = /*#__PURE__*/function () {
142
142
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(props) {
143
143
  var mediaProvider, _viewMediaClientConfig;
144
- return _regenerator.default.wrap(function _callee2$(_context2) {
144
+ return _regenerator.default.wrap(function (_context2) {
145
145
  while (1) switch (_context2.prev = _context2.next) {
146
146
  case 0:
147
- _context2.next = 2;
147
+ _context2.next = 1;
148
148
  return props.mediaProvider;
149
- case 2:
149
+ case 1:
150
150
  mediaProvider = _context2.sent;
151
151
  if (mediaProvider) {
152
152
  _viewMediaClientConfig = mediaProvider.viewMediaClientConfig;
153
153
  setViewMediaClientConfig(_viewMediaClientConfig);
154
154
  }
155
- case 4:
155
+ case 2:
156
156
  case "end":
157
157
  return _context2.stop();
158
158
  }