@atlaskit/editor-plugin-media 13.5.1 → 13.6.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 (115) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/nodeviews/mediaNodeView/media.js +8 -1
  3. package/dist/es2019/nodeviews/mediaNodeView/media.js +6 -1
  4. package/dist/esm/nodeviews/mediaNodeView/media.js +8 -1
  5. package/media-plugin/package.json +1 -8
  6. package/media-plugin-type/package.json +1 -8
  7. package/nodeviewHelpers/package.json +1 -8
  8. package/package.json +8 -4
  9. package/types/package.json +1 -8
  10. package/dist/types-ts4.5/entry-points/media-plugin-type.d.ts +0 -1
  11. package/dist/types-ts4.5/entry-points/media-plugin.d.ts +0 -1
  12. package/dist/types-ts4.5/entry-points/nodeview-helpers.d.ts +0 -1
  13. package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
  14. package/dist/types-ts4.5/index.d.ts +0 -3
  15. package/dist/types-ts4.5/mediaPlugin.d.ts +0 -2
  16. package/dist/types-ts4.5/mediaPluginType.d.ts +0 -107
  17. package/dist/types-ts4.5/nodeviews/__mocks__/mediaNodeUpdater.d.ts +0 -27
  18. package/dist/types-ts4.5/nodeviews/helpers.d.ts +0 -2
  19. package/dist/types-ts4.5/nodeviews/lazy-media-group.d.ts +0 -9
  20. package/dist/types-ts4.5/nodeviews/lazy-media-inline.d.ts +0 -9
  21. package/dist/types-ts4.5/nodeviews/mediaGroup.d.ts +0 -10
  22. package/dist/types-ts4.5/nodeviews/mediaGroupNext.d.ts +0 -37
  23. package/dist/types-ts4.5/nodeviews/mediaInline.d.ts +0 -49
  24. package/dist/types-ts4.5/nodeviews/mediaNodeUpdater.d.ts +0 -52
  25. package/dist/types-ts4.5/nodeviews/mediaNodeView/index.d.ts +0 -48
  26. package/dist/types-ts4.5/nodeviews/mediaNodeView/media.d.ts +0 -65
  27. package/dist/types-ts4.5/nodeviews/mediaSingle.d.ts +0 -38
  28. package/dist/types-ts4.5/nodeviews/mediaSingleNext.d.ts +0 -33
  29. package/dist/types-ts4.5/nodeviews/nodeviewHelpers.d.ts +0 -11
  30. package/dist/types-ts4.5/nodeviews/styles.d.ts +0 -17
  31. package/dist/types-ts4.5/nodeviews/toDOM-fixes/media.d.ts +0 -44
  32. package/dist/types-ts4.5/nodeviews/toDOM-fixes/mediaGroup.d.ts +0 -64
  33. package/dist/types-ts4.5/nodeviews/toDOM-fixes/mediaInline.d.ts +0 -29
  34. package/dist/types-ts4.5/nodeviews/toDOM-fixes/mediaSingle.d.ts +0 -45
  35. package/dist/types-ts4.5/nodeviews/toDOM-fixes/toDOMAttrs.d.ts +0 -29
  36. package/dist/types-ts4.5/nodeviews/types.d.ts +0 -50
  37. package/dist/types-ts4.5/pm-plugins/actions.d.ts +0 -7
  38. package/dist/types-ts4.5/pm-plugins/ai-generating-decoration.d.ts +0 -49
  39. package/dist/types-ts4.5/pm-plugins/alt-text/actions.d.ts +0 -10
  40. package/dist/types-ts4.5/pm-plugins/alt-text/commands.d.ts +0 -6
  41. package/dist/types-ts4.5/pm-plugins/alt-text/index.d.ts +0 -9
  42. package/dist/types-ts4.5/pm-plugins/alt-text/keymap.d.ts +0 -4
  43. package/dist/types-ts4.5/pm-plugins/alt-text/reducer.d.ts +0 -4
  44. package/dist/types-ts4.5/pm-plugins/alt-text/types.d.ts +0 -3
  45. package/dist/types-ts4.5/pm-plugins/alt-text/ui/AltTextEdit.d.ts +0 -47
  46. package/dist/types-ts4.5/pm-plugins/commands/captions.d.ts +0 -5
  47. package/dist/types-ts4.5/pm-plugins/commands/helpers.d.ts +0 -15
  48. package/dist/types-ts4.5/pm-plugins/commands/linking.d.ts +0 -9
  49. package/dist/types-ts4.5/pm-plugins/commands.d.ts +0 -24
  50. package/dist/types-ts4.5/pm-plugins/keymap-media.d.ts +0 -3
  51. package/dist/types-ts4.5/pm-plugins/keymap.d.ts +0 -10
  52. package/dist/types-ts4.5/pm-plugins/linking/actions.d.ts +0 -21
  53. package/dist/types-ts4.5/pm-plugins/linking/index.d.ts +0 -12
  54. package/dist/types-ts4.5/pm-plugins/linking/keymap.d.ts +0 -3
  55. package/dist/types-ts4.5/pm-plugins/linking/reducer.d.ts +0 -4
  56. package/dist/types-ts4.5/pm-plugins/linking/types.d.ts +0 -12
  57. package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -154
  58. package/dist/types-ts4.5/pm-plugins/media-editor-plugin-factory.d.ts +0 -3
  59. package/dist/types-ts4.5/pm-plugins/mediaTaskManager.d.ts +0 -9
  60. package/dist/types-ts4.5/pm-plugins/picker-facade.d.ts +0 -37
  61. package/dist/types-ts4.5/pm-plugins/pixel-resizing/commands.d.ts +0 -5
  62. package/dist/types-ts4.5/pm-plugins/pixel-resizing/index.d.ts +0 -15
  63. package/dist/types-ts4.5/pm-plugins/pixel-resizing/reducer.d.ts +0 -12
  64. package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/constants.d.ts +0 -3
  65. package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/index.d.ts +0 -22
  66. package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/pixel-entry.d.ts +0 -4
  67. package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/styles.d.ts +0 -8
  68. package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/types.d.ts +0 -86
  69. package/dist/types-ts4.5/pm-plugins/plugin-key.d.ts +0 -3
  70. package/dist/types-ts4.5/pm-plugins/types.d.ts +0 -82
  71. package/dist/types-ts4.5/pm-plugins/utils/analytics.d.ts +0 -6
  72. package/dist/types-ts4.5/pm-plugins/utils/batchMediaNodeAttrs.d.ts +0 -54
  73. package/dist/types-ts4.5/pm-plugins/utils/batchSteps.d.ts +0 -19
  74. package/dist/types-ts4.5/pm-plugins/utils/check-media-type.d.ts +0 -4
  75. package/dist/types-ts4.5/pm-plugins/utils/current-media-node.d.ts +0 -10
  76. package/dist/types-ts4.5/pm-plugins/utils/is-type.d.ts +0 -2
  77. package/dist/types-ts4.5/pm-plugins/utils/media-common.d.ts +0 -29
  78. package/dist/types-ts4.5/pm-plugins/utils/media-files.d.ts +0 -29
  79. package/dist/types-ts4.5/pm-plugins/utils/media-inline.d.ts +0 -6
  80. package/dist/types-ts4.5/pm-plugins/utils/media-single.d.ts +0 -18
  81. package/dist/types-ts4.5/types/index.d.ts +0 -212
  82. package/dist/types-ts4.5/types/media-plugin-options.d.ts +0 -16
  83. package/dist/types-ts4.5/ui/CaptionPlaceholder/index.d.ts +0 -16
  84. package/dist/types-ts4.5/ui/CommentBadge/index.d.ts +0 -18
  85. package/dist/types-ts4.5/ui/ImageBorder/index.d.ts +0 -11
  86. package/dist/types-ts4.5/ui/ImageBorder/styles.d.ts +0 -18
  87. package/dist/types-ts4.5/ui/Media/DropPlaceholder.d.ts +0 -11
  88. package/dist/types-ts4.5/ui/MediaLinkingToolbar.d.ts +0 -39
  89. package/dist/types-ts4.5/ui/MediaPicker/BrowserWrapper.d.ts +0 -12
  90. package/dist/types-ts4.5/ui/MediaPicker/ClipboardWrapper.d.ts +0 -11
  91. package/dist/types-ts4.5/ui/MediaPicker/DropzoneWrapper.d.ts +0 -13
  92. package/dist/types-ts4.5/ui/MediaPicker/PickerFacadeProvider.d.ts +0 -18
  93. package/dist/types-ts4.5/ui/MediaPicker/index.d.ts +0 -23
  94. package/dist/types-ts4.5/ui/MediaSSRReactContextsProvider.d.ts +0 -8
  95. package/dist/types-ts4.5/ui/MediaViewer/MediaViewerContainer.d.ts +0 -21
  96. package/dist/types-ts4.5/ui/MediaViewer/PortalWrapper.d.ts +0 -13
  97. package/dist/types-ts4.5/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.d.ts +0 -6
  98. package/dist/types-ts4.5/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +0 -9
  99. package/dist/types-ts4.5/ui/ResizableMediaSingle/index.d.ts +0 -50
  100. package/dist/types-ts4.5/ui/ResizableMediaSingle/styled.d.ts +0 -3
  101. package/dist/types-ts4.5/ui/ResizableMediaSingle/styles.d.ts +0 -2
  102. package/dist/types-ts4.5/ui/ResizableMediaSingle/types.d.ts +0 -30
  103. package/dist/types-ts4.5/ui/ToolbarMedia/index.d.ts +0 -13
  104. package/dist/types-ts4.5/ui/hooks/useMediaProvider.d.ts +0 -4
  105. package/dist/types-ts4.5/ui/toolbar/alt-text.d.ts +0 -17
  106. package/dist/types-ts4.5/ui/toolbar/commands.d.ts +0 -20
  107. package/dist/types-ts4.5/ui/toolbar/comments.d.ts +0 -6
  108. package/dist/types-ts4.5/ui/toolbar/imageBorder.d.ts +0 -2
  109. package/dist/types-ts4.5/ui/toolbar/index.d.ts +0 -16
  110. package/dist/types-ts4.5/ui/toolbar/layout-group.d.ts +0 -14
  111. package/dist/types-ts4.5/ui/toolbar/linking-toolbar-appearance.d.ts +0 -21
  112. package/dist/types-ts4.5/ui/toolbar/linking.d.ts +0 -11
  113. package/dist/types-ts4.5/ui/toolbar/mediaInline.d.ts +0 -8
  114. package/dist/types-ts4.5/ui/toolbar/pixel-resizing.d.ts +0 -8
  115. package/dist/types-ts4.5/ui/toolbar/utils.d.ts +0 -29
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 13.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`a80e758660883`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a80e758660883) -
8
+ add remixSource attribute to mediaCardRender events behind
9
+ cc-maui-add-mark-for-remix-generated-images FF
10
+
11
+ ## 13.5.2
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 13.5.1
4
18
 
5
19
  ### Patch Changes
@@ -298,6 +298,7 @@ var MediaNode = exports.MediaNode = /*#__PURE__*/function (_Component) {
298
298
  }, {
299
299
  key: "render",
300
300
  value: function render() {
301
+ var _dataConsumerMark$att;
301
302
  var _this$props2 = this.props,
302
303
  node = _this$props2.node,
303
304
  selected = _this$props2.selected,
@@ -308,6 +309,9 @@ var MediaNode = exports.MediaNode = /*#__PURE__*/function (_Component) {
308
309
  var borderMark = node.marks.find(function (m) {
309
310
  return m.type.name === 'border';
310
311
  });
312
+ var dataConsumerMark = (0, _platformFeatureFlags.fg)('cc-maui-add-mark-for-remix-generated-images') ? node.marks.find(function (m) {
313
+ return m.type.name === 'dataConsumer';
314
+ }) : undefined;
311
315
  var _this$state = this.state,
312
316
  viewMediaClientConfig = _this$state.viewMediaClientConfig,
313
317
  viewAndUploadMediaClientConfig = _this$state.viewAndUploadMediaClientConfig,
@@ -366,7 +370,10 @@ var MediaNode = exports.MediaNode = /*#__PURE__*/function (_Component) {
366
370
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
367
371
  , {
368
372
  data: (0, _defineProperty2.default)({}, _analyticsNamespacedContext.MEDIA_CONTEXT, {
369
- border: !!borderMark
373
+ border: !!borderMark,
374
+ // Only defined for remix-generated media (i.e. media nodes with a dataConsumer mark).
375
+ // Format: "remix:{type}:{subtype}" e.g. "remix:infographic:corporate-doodle"
376
+ remixSource: dataConsumerMark === null || dataConsumerMark === void 0 || (_dataConsumerMark$att = dataConsumerMark.attrs.sources) === null || _dataConsumerMark$att === void 0 ? void 0 : _dataConsumerMark$att[0]
370
377
  })
371
378
  }, /*#__PURE__*/_react.default.createElement(_mediaCard.Card, {
372
379
  mediaClientConfig: mediaClientConfig,
@@ -241,6 +241,7 @@ export class MediaNode extends Component {
241
241
  }
242
242
  }
243
243
  render() {
244
+ var _dataConsumerMark$att;
244
245
  const {
245
246
  node,
246
247
  selected,
@@ -250,6 +251,7 @@ export class MediaNode extends Component {
250
251
  mediaOptions
251
252
  } = this.props;
252
253
  const borderMark = node.marks.find(m => m.type.name === 'border');
254
+ const dataConsumerMark = fg('cc-maui-add-mark-for-remix-generated-images') ? node.marks.find(m => m.type.name === 'dataConsumer') : undefined;
253
255
  const {
254
256
  viewMediaClientConfig,
255
257
  viewAndUploadMediaClientConfig,
@@ -309,7 +311,10 @@ export class MediaNode extends Component {
309
311
  , {
310
312
  data: {
311
313
  [MEDIA_CONTEXT]: {
312
- border: !!borderMark
314
+ border: !!borderMark,
315
+ // Only defined for remix-generated media (i.e. media nodes with a dataConsumer mark).
316
+ // Format: "remix:{type}:{subtype}" e.g. "remix:infographic:corporate-doodle"
317
+ remixSource: dataConsumerMark === null || dataConsumerMark === void 0 ? void 0 : (_dataConsumerMark$att = dataConsumerMark.attrs.sources) === null || _dataConsumerMark$att === void 0 ? void 0 : _dataConsumerMark$att[0]
313
318
  }
314
319
  }
315
320
  }, /*#__PURE__*/React.createElement(Card, {
@@ -290,6 +290,7 @@ export var MediaNode = /*#__PURE__*/function (_Component) {
290
290
  }, {
291
291
  key: "render",
292
292
  value: function render() {
293
+ var _dataConsumerMark$att;
293
294
  var _this$props2 = this.props,
294
295
  node = _this$props2.node,
295
296
  selected = _this$props2.selected,
@@ -300,6 +301,9 @@ export var MediaNode = /*#__PURE__*/function (_Component) {
300
301
  var borderMark = node.marks.find(function (m) {
301
302
  return m.type.name === 'border';
302
303
  });
304
+ var dataConsumerMark = fg('cc-maui-add-mark-for-remix-generated-images') ? node.marks.find(function (m) {
305
+ return m.type.name === 'dataConsumer';
306
+ }) : undefined;
303
307
  var _this$state = this.state,
304
308
  viewMediaClientConfig = _this$state.viewMediaClientConfig,
305
309
  viewAndUploadMediaClientConfig = _this$state.viewAndUploadMediaClientConfig,
@@ -358,7 +362,10 @@ export var MediaNode = /*#__PURE__*/function (_Component) {
358
362
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
359
363
  , {
360
364
  data: _defineProperty({}, MEDIA_CONTEXT, {
361
- border: !!borderMark
365
+ border: !!borderMark,
366
+ // Only defined for remix-generated media (i.e. media nodes with a dataConsumer mark).
367
+ // Format: "remix:{type}:{subtype}" e.g. "remix:infographic:corporate-doodle"
368
+ remixSource: dataConsumerMark === null || dataConsumerMark === void 0 || (_dataConsumerMark$att = dataConsumerMark.attrs.sources) === null || _dataConsumerMark$att === void 0 ? void 0 : _dataConsumerMark$att[0]
362
369
  })
363
370
  }, /*#__PURE__*/React.createElement(Card, {
364
371
  mediaClientConfig: mediaClientConfig,
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/media-plugin.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/media-plugin.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/media-plugin.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/media-plugin-type.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/media-plugin-type.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/media-plugin-type.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/nodeview-helpers.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/nodeview-helpers.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/nodeview-helpers.d.ts"
17
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "13.5.1",
3
+ "version": "13.6.0",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -55,7 +55,7 @@
55
55
  "@atlaskit/icon": "^35.4.0",
56
56
  "@atlaskit/icon-lab": "^6.14.0",
57
57
  "@atlaskit/media-card": "^80.8.0",
58
- "@atlaskit/media-client": "^36.3.0",
58
+ "@atlaskit/media-client": "^36.4.0",
59
59
  "@atlaskit/media-client-react": "^5.2.0",
60
60
  "@atlaskit/media-common": "^13.3.0",
61
61
  "@atlaskit/media-filmstrip": "^51.3.0",
@@ -65,7 +65,7 @@
65
65
  "@atlaskit/platform-feature-flags": "^1.1.0",
66
66
  "@atlaskit/primitives": "^19.0.0",
67
67
  "@atlaskit/textfield": "^8.3.0",
68
- "@atlaskit/tmp-editor-statsig": "^102.0.0",
68
+ "@atlaskit/tmp-editor-statsig": "^103.0.0",
69
69
  "@atlaskit/tokens": "^13.4.0",
70
70
  "@atlaskit/tooltip": "^22.6.0",
71
71
  "@babel/runtime": "^7.0.0",
@@ -77,7 +77,7 @@
77
77
  "uuid": "^3.1.0"
78
78
  },
79
79
  "peerDependencies": {
80
- "@atlaskit/editor-common": "^115.15.0",
80
+ "@atlaskit/editor-common": "^115.16.0",
81
81
  "@atlaskit/media-core": "^37.1.0",
82
82
  "react": "^18.2.0",
83
83
  "react-dom": "^18.2.0",
@@ -161,6 +161,10 @@
161
161
  },
162
162
  "cc-maui-phase-2": {
163
163
  "type": "boolean"
164
+ },
165
+ "cc-maui-add-mark-for-remix-generated-images": {
166
+ "type": "boolean",
167
+ "referenceOnly": true
164
168
  }
165
169
  },
166
170
  "stricter": {
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/types.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/types.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/types.d.ts"
17
10
  }
@@ -1 +0,0 @@
1
- export type { MediaNextEditorPluginType as MediaPlugin, MediaPluginDependencies, } from '../mediaPluginType';
@@ -1 +0,0 @@
1
- export { mediaPlugin } from '../mediaPlugin';
@@ -1 +0,0 @@
1
- export { computeReplacementDisplayWidth } from '../nodeviews/nodeviewHelpers';
@@ -1 +0,0 @@
1
- export type { CustomMediaPicker, ForwardRef, InsertMediaAsMediaSingle, Listener, MediaCopyScope, MediaDecorationSpec, MediaEditorState, MediaFloatingToolbarOptions, MediaOptions, MediaPluginOptions, MediaPluginState, MediaSingleOptions, MediaSingleWithType, MediaState, MediaStateEventListener, MediaStateEventSubscriber, MediaStateStatus, MediaToolbarBaseConfig, MobileUploadEndEventPayload, ProsemirrorGetPosHandler, ReactNodeProps, SupportedMediaAttributes, getPosHandler, getPosHandlerNode, } from '../types/index';
@@ -1,3 +0,0 @@
1
- export type { MediaNextEditorPluginType as MediaPlugin, MediaPluginDependencies, } from './mediaPluginType';
2
- export type { MediaPluginOptions } from './types/index';
3
- export { mediaPlugin } from './mediaPlugin';
@@ -1,2 +0,0 @@
1
- import type { MediaNextEditorPluginType } from './mediaPluginType';
2
- export declare const mediaPlugin: MediaNextEditorPluginType;
@@ -1,107 +0,0 @@
1
- import type { MediaADFAttrs } from '@atlaskit/adf-schema';
2
- import type { InputMethodInsertMedia, InsertMediaVia } from '@atlaskit/editor-common/analytics';
3
- import type { MediaProvider } from '@atlaskit/editor-common/provider-factory';
4
- import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
5
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
6
- import type { AnnotationPlugin } from '@atlaskit/editor-plugin-annotation';
7
- import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
8
- import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
9
- import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
10
- import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
11
- import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
12
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
13
- import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
14
- import type { FocusPlugin } from '@atlaskit/editor-plugin-focus';
15
- import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
16
- import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
17
- import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
18
- import type { MediaEditingPlugin } from '@atlaskit/editor-plugin-media-editing';
19
- import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
20
- import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
21
- import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
22
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
23
- import type { AIGeneratingSource } from './pm-plugins/ai-generating-decoration';
24
- import type { MediaPluginState } from './pm-plugins/types';
25
- import type { InsertMediaAsMediaSingle } from './pm-plugins/utils/media-single';
26
- import type { MediaOptions } from './types';
27
- type MediaInsertPlugin = NextEditorPlugin<'mediaInsert', any>;
28
- export type MediaPluginDependencies = [
29
- OptionalPlugin<AnalyticsPlugin>,
30
- OptionalPlugin<ContextIdentifierPlugin>,
31
- OptionalPlugin<EditorViewModePlugin>,
32
- OptionalPlugin<GuidelinePlugin>,
33
- GridPlugin,
34
- WidthPlugin,
35
- DecorationsPlugin,
36
- FloatingToolbarPlugin,
37
- EditorDisabledPlugin,
38
- FocusPlugin,
39
- OptionalPlugin<MediaInsertPlugin>,
40
- OptionalPlugin<InteractionPlugin>,
41
- SelectionPlugin,
42
- OptionalPlugin<AnnotationPlugin>,
43
- OptionalPlugin<FeatureFlagsPlugin>,
44
- OptionalPlugin<ConnectivityPlugin>,
45
- OptionalPlugin<InteractionPlugin>,
46
- OptionalPlugin<ToolbarPlugin>,
47
- OptionalPlugin<MediaEditingPlugin>
48
- ];
49
- export type MediaNextEditorPluginType = NextEditorPlugin<'media', {
50
- actions: {
51
- /**
52
- * Callback to be called when there is an error rendering a media node.
53
- */
54
- handleMediaNodeRenderError: (node: PMNode, reason: string, nestedUnder?: string) => void;
55
- /**
56
- * @private
57
- * @deprecated Use the command `insertMediaSingle` instead which is decoupled from EditorView
58
- * and easier to use.
59
- */
60
- insertMediaAsMediaSingle: InsertMediaAsMediaSingle;
61
- /**
62
- * Used to update the initial provider passed to the media plugin.
63
- *
64
- * For performance reasons if you attempt to set the same provider more
65
- * than once this method will fail and return false.
66
- *
67
- * @param provider Promise<MediaProvider>
68
- * @returns {boolean} if setting the provider was successful or not
69
- */
70
- setProvider: (provider: Promise<MediaProvider>) => boolean;
71
- };
72
- commands: {
73
- /**
74
- * Clears the AI-generating decoration for a specific media node identified by
75
- * `mediaId`. Removes the AI border from that media node.
76
- */
77
- clearAIGenerating: (mediaId: string) => EditorCommand;
78
- hideMediaViewer: EditorCommand;
79
- /**
80
- * Inserts a media node as a media single.
81
- * This command creates a media single node from a set of attributes
82
- *
83
- * @param attrs - The media node attributes of the node to insert
84
- * @param inputMethod - The method used to input the media
85
- * @param insertMediaVia - Optional parameter indicating how the media was inserted
86
- * @param positions - Optional parameter indicating the positions for the insertion
87
- */
88
- insertMediaSingle: (attrs: MediaADFAttrs, inputMethod: InputMethodInsertMedia, insertMediaVia?: InsertMediaVia, positions?: [
89
- number,
90
- number
91
- ], dataConsumerSource?: string) => EditorCommand;
92
- /**
93
- * Sets the AI-generating decoration on a media node identified by `mediaId`.
94
- * Renders an AI border around the media node while AI is generating/replacing it.
95
- *
96
- * Decorations live in the view layer only and never affect the document model
97
- * or undo/redo history.
98
- */
99
- setAIGenerating: (mediaId: string, source?: AIGeneratingSource) => EditorCommand;
100
- showMediaViewer: (media: MediaADFAttrs) => EditorCommand;
101
- trackMediaPaste: (attrs: MediaADFAttrs) => EditorCommand;
102
- };
103
- dependencies: MediaPluginDependencies;
104
- pluginConfiguration: MediaOptions | undefined;
105
- sharedState: MediaPluginState | null;
106
- }>;
107
- export {};
@@ -1,27 +0,0 @@
1
- export declare class MediaNodeUpdater {
2
- static instances: MediaNodeUpdater[];
3
- static mockOverrides: {};
4
- static mockReset(): void;
5
- constructor();
6
- static setMock(thisKey: string, value: any): void;
7
- setProps(): void;
8
- updateContextId(): Promise<void>;
9
- updateNodeContextId(): Promise<void>;
10
- getAttrs(): void;
11
- getObjectId(): Promise<void>;
12
- getNodeContextId(): void;
13
- updateDimensions(): void;
14
- getRemoteDimensions(): Promise<void>;
15
- isNodeFromDifferentCollection(): Promise<void>;
16
- hasDifferentContextId(): Promise<void>;
17
- shouldNodeBeDeepCopied(): Promise<void>;
18
- copyNode(): Promise<void>;
19
- copyNodeFromPos(): Promise<void>;
20
- updateMediaSingleFileAttrs(): Promise<void>;
21
- uploadExternalMedia(): Promise<void>;
22
- isMediaBlobUrl(): void;
23
- copyNodeFromBlobUrl(): void;
24
- updateNodeAttrs(): void;
25
- handleExternalMedia(): Promise<void>;
26
- }
27
- export declare function createMediaNodeUpdater(): MediaNodeUpdater;
@@ -1,2 +0,0 @@
1
- import type { MediaAttributes } from '@atlaskit/adf-schema';
2
- export declare const hasPrivateAttrsChanged: (currentAttrs: MediaAttributes, newAttrs: Partial<MediaAttributes>) => boolean;
@@ -1,9 +0,0 @@
1
- import type { IntlShape } from 'react-intl';
2
- import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
3
- import type { NodeViewConstructor } from '@atlaskit/editor-common/lazy-node-view';
4
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
5
- import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
7
- import type { MediaNextEditorPluginType } from '../mediaPluginType';
8
- import type { MediaPluginOptions } from '../types';
9
- export declare const lazyMediaGroupView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: MediaPluginOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, intl?: IntlShape) => NodeViewConstructor;
@@ -1,9 +0,0 @@
1
- import type { IntlShape } from 'react-intl';
2
- import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
3
- import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
- import { type NodeViewConstructor } from '@atlaskit/editor-common/lazy-node-view';
5
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
6
- import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
7
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
- import type { MediaNextEditorPluginType } from '../mediaPluginType';
9
- export declare const lazyMediaInlineView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, dispatchAnalyticsEvent?: DispatchAnalyticsEvent, fallbackMediaNameFetcher?: (id: string) => Promise<string>, intl?: IntlShape) => NodeViewConstructor;
@@ -1,10 +0,0 @@
1
- import type { IntlShape } from 'react-intl';
2
- import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
3
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
4
- import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
7
- import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
8
- import type { MediaNextEditorPluginType } from '../mediaPluginType';
9
- import type { getPosHandler, MediaPluginOptions } from '../types';
10
- export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaPluginOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, intl?: IntlShape) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
@@ -1,37 +0,0 @@
1
- import React from 'react';
2
- import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
3
- import type { ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
4
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
5
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- import type { MediaOptions } from '../types';
7
- export declare const MediaGroupNext: React.FC<WithIntlProps<{
8
- allowLazyLoading?: boolean;
9
- anchorPos: number;
10
- contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
11
- disabled?: boolean;
12
- editorViewMode?: boolean;
13
- forwardRef?: (ref: HTMLElement) => void;
14
- getPos: () => number | undefined;
15
- headPos: number;
16
- isCopyPasteEnabled?: boolean;
17
- mediaOptions: MediaOptions;
18
- mediaProvider?: Promise<MediaProvider>;
19
- node: PMNode;
20
- view: EditorView;
21
- } & WrappedComponentProps>> & {
22
- WrappedComponent: React.ComponentType<{
23
- allowLazyLoading?: boolean;
24
- anchorPos: number;
25
- contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
26
- disabled?: boolean;
27
- editorViewMode?: boolean;
28
- forwardRef?: (ref: HTMLElement) => void;
29
- getPos: () => number | undefined;
30
- headPos: number;
31
- isCopyPasteEnabled?: boolean;
32
- mediaOptions: MediaOptions;
33
- mediaProvider?: Promise<MediaProvider>;
34
- node: PMNode;
35
- view: EditorView;
36
- } & WrappedComponentProps>;
37
- };
@@ -1,49 +0,0 @@
1
- import { jsx } from '@emotion/react';
2
- import type { IntlShape } from 'react-intl';
3
- import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
4
- import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
5
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
6
- import type { ContextIdentifierProvider, MediaProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
7
- import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
8
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
9
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
10
- import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
11
- import type { FileIdentifier } from '@atlaskit/media-client';
12
- import type { MediaClientConfig } from '@atlaskit/media-core/auth';
13
- import type { MediaNextEditorPluginType } from '../mediaPluginType';
14
- import type { getPosHandler, getPosHandler as ProsemirrorGetPosHandler } from '../types';
15
- export interface MediaInlineProps {
16
- addPendingTask: (promise: Promise<any>) => void;
17
- allowInlineImages?: boolean;
18
- contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
19
- dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
20
- editorViewMode?: boolean;
21
- fallbackMediaNameFetcher?: (id: string) => Promise<string>;
22
- getPos: ProsemirrorGetPosHandler;
23
- handleMediaNodeMount: (node: PMNode, getPos: ProsemirrorGetPosHandler) => void;
24
- handleMediaNodeUnmount: (node: PMNode) => void;
25
- identifier: FileIdentifier;
26
- isSelected: boolean;
27
- mediaClientConfig: MediaClientConfig;
28
- mediaProvider: Promise<MediaProvider>;
29
- node: PMNode;
30
- selectedMediaContainerNode: () => PMNode | undefined;
31
- view: EditorView;
32
- }
33
- export declare const handleNewNode: (props: MediaInlineProps) => void;
34
- export declare const MediaInline: (props: MediaInlineProps) => jsx.JSX.Element;
35
- interface MediaInlineNodeViewProps {
36
- api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
37
- dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
38
- fallbackMediaNameFetcher?: (id: string) => Promise<string>;
39
- intl?: IntlShape;
40
- providerFactory: ProviderFactory;
41
- }
42
- export declare class MediaInlineNodeView extends SelectionBasedNodeView<MediaInlineNodeViewProps> {
43
- createDomRef(): HTMLSpanElement;
44
- ignoreMutation(): boolean;
45
- viewShouldUpdate(nextNode: PMNode): boolean;
46
- render(props: MediaInlineNodeViewProps): jsx.JSX.Element;
47
- }
48
- export declare const ReactMediaInlineNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, dispatchAnalyticsEvent?: DispatchAnalyticsEvent, fallbackMediaNameFetcher?: (id: string) => Promise<string>, intl?: IntlShape) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
49
- export {};
@@ -1,52 +0,0 @@
1
- import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
2
- import type { ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
3
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
- import { type MediaTraceContext } from '@atlaskit/media-common';
6
- import type { getPosHandler as ProsemirrorGetPosHandler, MediaOptions, MediaPluginState, SupportedMediaAttributes } from '../types';
7
- type RemoteDimensions = {
8
- height: number;
9
- id: string;
10
- width: number;
11
- };
12
- export interface MediaNodeUpdaterProps {
13
- contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
14
- dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
15
- isMediaSingle: boolean;
16
- /** Content column width in pixels, used to clamp display width on media replacement. */
17
- lineLength?: number;
18
- mediaOptions?: MediaOptions;
19
- mediaProvider?: Promise<MediaProvider>;
20
- node: PMNode;
21
- view: EditorView;
22
- }
23
- export declare class MediaNodeUpdater {
24
- props: MediaNodeUpdaterProps;
25
- mediaPluginState: MediaPluginState | undefined;
26
- constructor(props: MediaNodeUpdaterProps);
27
- setProps(newComponentProps: Partial<MediaNodeUpdaterProps>): void;
28
- isMediaBlobUrl(): boolean;
29
- updateContextId: () => Promise<void>;
30
- updateNodeContextId: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
31
- private hasFileAttributesDefined;
32
- private getNewFileAttrsForNode;
33
- updateMediaSingleFileAttrs: () => Promise<void>;
34
- updateNodeAttrs: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
35
- getAttrs: () => SupportedMediaAttributes | undefined;
36
- getObjectId: () => Promise<string | null>;
37
- uploadExternalMedia: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
38
- getNodeContextId: () => string | null;
39
- updateDimensions: (dimensions: RemoteDimensions) => void;
40
- getRemoteDimensions(): Promise<false | RemoteDimensions>;
41
- shouldNodeBeDeepCopied: () => Promise<boolean>;
42
- hasDifferentContextId: () => Promise<boolean>;
43
- isNodeFromDifferentCollection: () => Promise<boolean>;
44
- handleExternalMedia(getPos: ProsemirrorGetPosHandler): Promise<void>;
45
- private handleCopyFileSwitcher;
46
- copyNodeFromBlobUrl: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
47
- copyNodeFromPos: (getPos: ProsemirrorGetPosHandler, traceContext?: MediaTraceContext) => Promise<void>;
48
- copyNode: (traceContext?: MediaTraceContext) => Promise<void>;
49
- private copyFile;
50
- }
51
- export declare const createMediaNodeUpdater: (props: MediaNodeUpdaterProps) => MediaNodeUpdater;
52
- export {};
@@ -1,48 +0,0 @@
1
- import React from 'react';
2
- import type { IntlShape } from 'react-intl';
3
- import type { MediaADFAttrs } from '@atlaskit/adf-schema';
4
- import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
5
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
6
- import type { ContextIdentifierProvider, MediaProvider, ProviderFactory, Providers } from '@atlaskit/editor-common/provider-factory';
7
- import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
8
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
9
- import type { SharedInteractionState } from '@atlaskit/editor-plugin-interaction';
10
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
11
- import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
12
- import type { MediaNextEditorPluginType } from '../../mediaPluginType';
13
- import type { getPosHandler, getPosHandlerNode, MediaOptions, MediaPluginOptions } from '../../types';
14
- import type { MediaNodeViewProps } from '../types';
15
- interface MediaNodeWithPluginStateComponentProps {
16
- interactionState?: SharedInteractionState['interactionState'];
17
- mediaProvider?: Promise<MediaProvider>;
18
- }
19
- declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
20
- private isSelected;
21
- private isAIGenerating;
22
- private hasBeenResized;
23
- private resizeListenerBinding?;
24
- getMediaSingleNode(getPos: getPosHandlerNode): PMNode | null;
25
- getMaxWidthFromMediaSingleNode(mediaSingleNode: PMNode): number;
26
- hasPxWidthType(mediaSingleNode: PMNode): boolean;
27
- hasResizedListener: () => void;
28
- createDomRef(): HTMLElement;
29
- viewShouldUpdate(nextNode: PMNode, decorations: Decoration[]): boolean;
30
- stopEvent(event: Event): boolean;
31
- getAttrs(): MediaADFAttrs;
32
- isMediaBlobUrl(): boolean;
33
- onExternalImageLoaded: (dimensions: {
34
- height: number;
35
- width: number;
36
- }) => void;
37
- getMaxCardDimensions: () => {
38
- height: string;
39
- width: string;
40
- };
41
- getMediaProviderToUse: (mediaOptions: MediaOptions, mediaProvider?: Promise<MediaProvider>) => Promise<MediaProvider> | undefined;
42
- renderMediaNodeWithState: (contextIdentifierProvider?: Promise<ContextIdentifierProvider>) => ({ mediaProvider, interactionState, }: MediaNodeWithPluginStateComponentProps) => React.JSX.Element;
43
- renderMediaNodeWithProviders: ({ contextIdentifierProvider }: Providers) => React.JSX.Element;
44
- render(): React.JSX.Element;
45
- destroy(): void;
46
- }
47
- export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaPluginOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, intl?: IntlShape) => (node: PMNode, view: EditorView, getPos: getPosHandler) => MediaNodeView;
48
- export {};