@atlaskit/editor-plugin-media 0.4.6 → 0.4.8

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,17 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 0.4.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 0.4.7
10
+
11
+ ### Patch Changes
12
+
13
+ - [#56790](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/56790) [`ff577a7969d4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ff577a7969d4) - ED-21266: Updated @atlaskit/adf-schema to 34.0.1
14
+
3
15
  ## 0.4.6
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,11 +32,11 @@
32
32
  "./types": "./src/types.ts"
33
33
  },
34
34
  "dependencies": {
35
- "@atlaskit/adf-schema": "^34.0.0",
35
+ "@atlaskit/adf-schema": "^34.0.1",
36
36
  "@atlaskit/analytics-namespaced-context": "^6.7.0",
37
37
  "@atlaskit/analytics-next": "^9.1.0",
38
38
  "@atlaskit/button": "^16.17.0",
39
- "@atlaskit/editor-common": "^76.23.0",
39
+ "@atlaskit/editor-common": "^76.24.0",
40
40
  "@atlaskit/editor-palette": "1.5.2",
41
41
  "@atlaskit/editor-plugin-analytics": "^0.3.0",
42
42
  "@atlaskit/editor-plugin-decorations": "^0.2.0",
@@ -54,8 +54,8 @@
54
54
  "@atlaskit/form": "^9.0.0",
55
55
  "@atlaskit/icon": "^22.0.0",
56
56
  "@atlaskit/media-card": "^77.4.0",
57
- "@atlaskit/media-client": "^25.0.0",
58
- "@atlaskit/media-client-react": "^1.4.0",
57
+ "@atlaskit/media-client": "^25.1.0",
58
+ "@atlaskit/media-client-react": "^2.0.0",
59
59
  "@atlaskit/media-common": "^11.0.0",
60
60
  "@atlaskit/media-filmstrip": "^47.0.0",
61
61
  "@atlaskit/media-picker": "^66.2.0",
@@ -1,392 +0,0 @@
1
- ## API Report File for "@atlaskit/editor-plugin-media"
2
-
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
-
5
- ```ts
6
-
7
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
8
- import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
9
- import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
10
- import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
11
- import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
12
- import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
13
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
14
- import type { ErrorReporter } from '@atlaskit/editor-common/utils';
15
- import type { ErrorReportingHandler } from '@atlaskit/editor-common/utils';
16
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
17
- import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
18
- import type { FocusPlugin } from '@atlaskit/editor-plugin-focus';
19
- import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
20
- import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
21
- import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
22
- import type { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
23
- import type { MediaClientConfig } from '@atlaskit/media-core';
24
- import type { MediaFeatureFlags } from '@atlaskit/media-common';
25
- import type { MediaFeatureFlags as MediaFeatureFlags_2 } from '@atlaskit/media-common/mediaFeatureFlags';
26
- import type { MediaFile } from '@atlaskit/media-picker/types';
27
- import type { MediaProvider as MediaProvider_2 } from '@atlaskit/editor-common/provider-factory';
28
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
29
- import type { Node as Node_2 } from '@atlaskit/editor-prosemirror/model';
30
- import type { NodeView } from '@atlaskit/editor-prosemirror/view';
31
- import type { OptionalPlugin } from '@atlaskit/editor-common/types';
32
- import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
33
- import type { Providers } from '@atlaskit/editor-common/provider-factory';
34
- import type { RichMediaLayout } from '@atlaskit/adf-schema';
35
- import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
36
- import type { UploadEndEventPayload } from '@atlaskit/media-picker/types';
37
- import type { UploadErrorEventPayload } from '@atlaskit/media-picker/types';
38
- import type { UploadParams } from '@atlaskit/media-picker/types';
39
- import type { UploadPreviewUpdateEventPayload } from '@atlaskit/media-picker/types';
40
- import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
41
-
42
- // @public (undocumented)
43
- interface CustomMediaPicker {
44
- // (undocumented)
45
- destroy(): void;
46
- // (undocumented)
47
- emit(event: string, data: any): void;
48
- // (undocumented)
49
- on(event: string, cb: Listener): void;
50
- // (undocumented)
51
- removeAllListeners(event: any): void;
52
- // (undocumented)
53
- setUploadParams(uploadParams: UploadParams): void;
54
- }
55
-
56
- // @public (undocumented)
57
- type getPosHandler = getPosHandlerNode;
58
-
59
- // @public (undocumented)
60
- type getPosHandlerNode = () => number | undefined;
61
-
62
- // @public (undocumented)
63
- type InsertMediaAsMediaSingle = (view: EditorView, node: Node_2, inputMethod: InputMethodInsertMedia) => boolean;
64
-
65
- // @public (undocumented)
66
- type Listener = (data: any) => void;
67
-
68
- // @public (undocumented)
69
- interface MediaNodeWithPosHandler {
70
- // (undocumented)
71
- getPos: ProsemirrorGetPosHandler;
72
- // (undocumented)
73
- node: Node_2;
74
- }
75
-
76
- // @public (undocumented)
77
- interface MediaOptions {
78
- // (undocumented)
79
- alignLeftOnInsert?: boolean;
80
- // (undocumented)
81
- allowAdvancedToolBarOptions?: boolean;
82
- // (undocumented)
83
- allowAltTextOnImages?: boolean;
84
- // (undocumented)
85
- allowBreakoutSnapPoints?: boolean;
86
- // (undocumented)
87
- allowCaptions?: boolean;
88
- // (undocumented)
89
- allowDropzoneDropLine?: boolean;
90
- // (undocumented)
91
- allowLazyLoading?: boolean;
92
- // (undocumented)
93
- allowLinking?: boolean;
94
- // (undocumented)
95
- allowMarkingUploadsAsIncomplete?: boolean;
96
- // (undocumented)
97
- allowMediaGroup?: boolean;
98
- // (undocumented)
99
- allowMediaSingle?: MediaSingleOptions | boolean;
100
- // (undocumented)
101
- allowMediaSingleEditable?: boolean;
102
- // (undocumented)
103
- allowRemoteDimensionsFetch?: boolean;
104
- // (undocumented)
105
- allowResizing?: boolean;
106
- // (undocumented)
107
- allowResizingInTables?: boolean;
108
- // (undocumented)
109
- allowTemplatePlaceholders?: PlaceholderTextOptions | boolean;
110
- // (undocumented)
111
- altTextValidator?: (value: string) => string[];
112
- // (undocumented)
113
- customDropzoneContainer?: HTMLElement;
114
- // (undocumented)
115
- customMediaPicker?: CustomMediaPicker;
116
- // (undocumented)
117
- editorSelectionAPI?: EditorSelectionAPI;
118
- // (undocumented)
119
- enableDownloadButton?: boolean;
120
- // (undocumented)
121
- featureFlags?: MediaFeatureFlags;
122
- // (undocumented)
123
- fullWidthEnabled?: boolean;
124
- // (undocumented)
125
- getEditorFeatureFlags?: GetEditorFeatureFlags;
126
- // (undocumented)
127
- isCopyPasteEnabled?: boolean;
128
- // (undocumented)
129
- provider?: Providers['mediaProvider'];
130
- // (undocumented)
131
- uploadErrorHandler?: (state: MediaState) => void;
132
- // (undocumented)
133
- useForgePlugins?: boolean;
134
- // (undocumented)
135
- waitForMediaUpload?: boolean;
136
- }
137
-
138
- // @public (undocumented)
139
- export type MediaPlugin = NextEditorPlugin<'media', {
140
- pluginConfiguration: MediaOptions | undefined;
141
- dependencies: [
142
- OptionalPlugin<FeatureFlagsPlugin>,
143
- OptionalPlugin<AnalyticsPlugin>,
144
- GuidelinePlugin,
145
- GridPlugin,
146
- WidthPlugin,
147
- DecorationsPlugin,
148
- FloatingToolbarPlugin,
149
- EditorDisabledPlugin,
150
- FocusPlugin,
151
- SelectionPlugin
152
- ];
153
- sharedState: MediaPluginState | null;
154
- actions: {
155
- insertMediaAsMediaSingle: InsertMediaAsMediaSingle;
156
- };
157
- }>;
158
-
159
- // @public (undocumented)
160
- export const mediaPlugin: MediaPlugin;
161
-
162
- // @public (undocumented)
163
- type MediaPluginOptions = {
164
- providerFactory: ProviderFactory;
165
- nodeViews: {
166
- [name: string]: (node: Node_2, view: EditorView, getPos: getPosHandler) => NodeView;
167
- };
168
- errorReporter?: ErrorReporter;
169
- uploadErrorHandler?: (state: MediaState) => void;
170
- waitForMediaUpload?: boolean;
171
- customDropzoneContainer?: HTMLElement;
172
- customMediaPicker?: CustomMediaPicker;
173
- allowResizing: boolean;
174
- };
175
-
176
- // @public (undocumented)
177
- interface MediaPluginState {
178
- // (undocumented)
179
- addPendingTask: (promise: Promise<any>) => void;
180
- // (undocumented)
181
- allowsUploads: boolean;
182
- // (undocumented)
183
- allUploadsFinished: boolean;
184
- // (undocumented)
185
- clone(): MediaPluginState;
186
- // (undocumented)
187
- currentMaxWidth?: number;
188
- // (undocumented)
189
- destroy(): void;
190
- // (undocumented)
191
- dispatch?: Dispatch;
192
- // (undocumented)
193
- editingMediaSinglePos?: number;
194
- // (undocumented)
195
- element?: HTMLElement;
196
- // (undocumented)
197
- findMediaNode: (id: string) => MediaNodeWithPosHandler | null;
198
- // (undocumented)
199
- getMediaOptions: () => MediaPluginOptions;
200
- // (undocumented)
201
- handleDrag: (dragState: 'enter' | 'leave') => void;
202
- // (undocumented)
203
- handleMediaGroupUpdate: (oldNodes: Node_2[], newNodes: Node_2[]) => void;
204
- // (undocumented)
205
- handleMediaNodeMount: (node: Node_2, getPos: ProsemirrorGetPosHandler) => void;
206
- // (undocumented)
207
- handleMediaNodeRemoval: (node: Node_2 | undefined, getPos: ProsemirrorGetPosHandler) => void;
208
- // (undocumented)
209
- handleMediaNodeUnmount: (oldNode: Node_2) => void;
210
- // (undocumented)
211
- ignoreLinks: boolean;
212
- // (undocumented)
213
- insertFile: (mediaState: MediaState, onMediaStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
214
- // (undocumented)
215
- isFullscreen: boolean;
216
- // (undocumented)
217
- isResizing: boolean;
218
- // (undocumented)
219
- layout: RichMediaLayout;
220
- // (undocumented)
221
- mediaClientConfig?: MediaClientConfig;
222
- // (undocumented)
223
- mediaNodes: MediaNodeWithPosHandler[];
224
- // (undocumented)
225
- mediaOptions?: MediaOptions;
226
- // (undocumented)
227
- mediaProvider?: MediaProvider_2;
228
- // (undocumented)
229
- onContextIdentifierProvider: (_name: string, provider?: Promise<ContextIdentifierProvider>) => Promise<void>;
230
- // (undocumented)
231
- onPopupPickerClose: () => void;
232
- // (undocumented)
233
- onPopupToggle: (onPopupToogleCallback: (isOpen: boolean) => void) => void;
234
- // (undocumented)
235
- options: MediaPluginOptions;
236
- // (undocumented)
237
- pickerPromises: Array<Promise<PickerFacade>>;
238
- // (undocumented)
239
- pickers: PickerFacade[];
240
- // (undocumented)
241
- removeSelectedMediaContainer: () => boolean;
242
- // (undocumented)
243
- resizingWidth: number;
244
- // (undocumented)
245
- selectedMediaContainerNode: () => Node_2 | undefined;
246
- // (undocumented)
247
- setBrowseFn: (browseFn: () => void) => void;
248
- // (undocumented)
249
- setIsResizing(isResizing: boolean): void;
250
- // (undocumented)
251
- setMediaProvider: (mediaProvider?: Promise<MediaProvider_2>) => Promise<void>;
252
- // (undocumented)
253
- setResizingWidth(width: number): void;
254
- // (undocumented)
255
- setView(view: EditorView): void;
256
- // (undocumented)
257
- showDropzone: boolean;
258
- // (undocumented)
259
- showEditingDialog?: boolean;
260
- // (undocumented)
261
- showMediaPicker: () => void;
262
- // (undocumented)
263
- splitMediaGroup: () => boolean;
264
- // (undocumented)
265
- updateAndDispatch(props: Partial<Pick<this, 'allUploadsFinished' | 'allowsUploads' | 'isFullscreen'>>): void;
266
- // (undocumented)
267
- updateElement(): void;
268
- // (undocumented)
269
- updateMediaSingleNodeAttrs: (id: string, attrs: object) => boolean | undefined;
270
- // (undocumented)
271
- uploadMediaClientConfig?: MediaClientConfig;
272
- // (undocumented)
273
- waitForMediaUpload: boolean;
274
- // (undocumented)
275
- waitForPendingTasks: (timeout?: number, lastTask?: Promise<MediaState | null>) => Promise<MediaState | null>;
276
- }
277
-
278
- // @public (undocumented)
279
- interface MediaSingleOptions {
280
- // (undocumented)
281
- disableLayout?: boolean;
282
- }
283
-
284
- // @public (undocumented)
285
- interface MediaState {
286
- // (undocumented)
287
- collection?: string;
288
- // (undocumented)
289
- contextId?: string;
290
- // (undocumented)
291
- dimensions?: {
292
- width: number | undefined;
293
- height: number | undefined;
294
- };
295
- // (undocumented)
296
- error?: {
297
- name: string;
298
- description: string;
299
- };
300
- // (undocumented)
301
- fileMimeType?: string;
302
- // (undocumented)
303
- fileName?: string;
304
- // (undocumented)
305
- fileSize?: number;
306
- // (undocumented)
307
- id: string;
308
- publicId?: string;
309
- // (undocumented)
310
- scaleFactor?: number;
311
- // (undocumented)
312
- status?: MediaStateStatus;
313
- }
314
-
315
- // @public (undocumented)
316
- type MediaStateEvent = MediaState;
317
-
318
- // @public (undocumented)
319
- type MediaStateEventListener = (evt: MediaStateEvent) => void;
320
-
321
- // @public (undocumented)
322
- type MediaStateEventSubscriber = (listener: MediaStateEventListener) => void;
323
-
324
- // @public (undocumented)
325
- type MediaStateStatus = 'cancelled' | 'error' | 'mobile-upload-end' | 'preview' | 'ready' | 'unknown';
326
-
327
- // @public (undocumented)
328
- type MobileUploadEndEventPayload = {
329
- readonly file: MediaFile & {
330
- readonly collectionName?: string;
331
- readonly publicId?: string;
332
- };
333
- };
334
-
335
- // @public (undocumented)
336
- type NewMediaEvent = (state: MediaState, onStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
337
-
338
- // @public (undocumented)
339
- class PickerFacade {
340
- constructor(pickerType: PickerType, config: PickerFacadeConfig, pickerConfig?: CustomMediaPicker | null | undefined, analyticsName?: string);
341
- // (undocumented)
342
- readonly config: PickerFacadeConfig;
343
- // (undocumented)
344
- destroy(): void;
345
- // (undocumented)
346
- erroredFiles: Set<string>;
347
- // (undocumented)
348
- handleMobileUploadEnd: (event: MobileUploadEndEventPayload) => void;
349
- // (undocumented)
350
- handleReady: (event: UploadEndEventPayload) => void;
351
- // (undocumented)
352
- handleUploadError: ({ error, fileId }: UploadErrorEventPayload) => void;
353
- // (undocumented)
354
- handleUploadPreviewUpdate: (event: UploadPreviewUpdateEventPayload) => void;
355
- // (undocumented)
356
- init(): Promise<PickerFacade>;
357
- // (undocumented)
358
- get mediaPicker(): CustomMediaPicker | undefined;
359
- // (undocumented)
360
- onDrag(cb: (state: 'enter' | 'leave') => any): void;
361
- // (undocumented)
362
- onNewMedia(cb: NewMediaEvent): void;
363
- // (undocumented)
364
- readonly pickerConfig?: CustomMediaPicker | null | undefined;
365
- // (undocumented)
366
- setUploadParams(params: UploadParams): void;
367
- // (undocumented)
368
- get type(): PickerType;
369
- }
370
-
371
- // @public (undocumented)
372
- type PickerFacadeConfig = {
373
- mediaClientConfig: MediaClientConfig;
374
- errorReporter: ErrorReportingHandler;
375
- featureFlags?: MediaFeatureFlags_2;
376
- };
377
-
378
- // @public (undocumented)
379
- type PickerType = 'clipboard' | 'customMediaPicker' | 'dropzone';
380
-
381
- // @public (undocumented)
382
- interface PlaceholderTextOptions {
383
- // (undocumented)
384
- allowInserting?: boolean;
385
- }
386
-
387
- // @public (undocumented)
388
- type ProsemirrorGetPosHandler = getPosHandlerNode;
389
-
390
- // (No @packageDocumentation comment for this package)
391
-
392
- ```