@atlaskit/editor-core 187.13.2 → 187.13.5
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 +14 -0
- package/dist/cjs/plugins/media/pm-plugins/main.js +6 -5
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +6 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/media/pm-plugins/main.js +5 -3
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +6 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +6 -5
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +6 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/media/pm-plugins/main.d.ts +3 -4
- package/dist/types-ts4.5/plugins/media/pm-plugins/main.d.ts +3 -4
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 187.13.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`30d82d3462c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/30d82d3462c) - [ED-19175] add missing support for the unsupportedBlock in table related nodes
|
|
8
|
+
- [`b041e51896d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b041e51896d) - Fix width plugin state reading when inserting a media single node
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 187.13.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`62d6f381722`](https://bitbucket.org/atlassian/atlassian-frontend/commits/62d6f381722) - ED-18969 preliminaary refactor for relative guideline.
|
|
16
|
+
|
|
3
17
|
## 187.13.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -71,9 +71,7 @@ var createDropPlaceholder = function createDropPlaceholder(intl, allowDropLine)
|
|
|
71
71
|
var MEDIA_RESOLVED_STATES = ['ready', 'error', 'cancelled'];
|
|
72
72
|
var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
73
73
|
function MediaPluginStateImplementation(_state, options, mediaOptions, newInsertionBehaviour, _dispatch, pluginInjectionApi) {
|
|
74
|
-
var _this = this
|
|
75
|
-
_pluginInjectionApi$d,
|
|
76
|
-
_pluginInjectionApi$d2;
|
|
74
|
+
var _this = this;
|
|
77
75
|
(0, _classCallCheck2.default)(this, MediaPluginStateImplementation);
|
|
78
76
|
(0, _defineProperty2.default)(this, "allowsUploads", false);
|
|
79
77
|
(0, _defineProperty2.default)(this, "ignoreLinks", false);
|
|
@@ -242,7 +240,10 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
242
240
|
});
|
|
243
241
|
}
|
|
244
242
|
if ((0, _mediaSingle.isMediaSingle)(state.schema, mediaStateWithContext.fileMimeType)) {
|
|
245
|
-
|
|
243
|
+
var _this$pluginInjection;
|
|
244
|
+
// read width state right before inserting to get up-to-date and define values
|
|
245
|
+
var widthPluginState = (_this$pluginInjection = _this.pluginInjectionApi) === null || _this$pluginInjection === void 0 ? void 0 : _this$pluginInjection.dependencies.width.sharedState.currentState();
|
|
246
|
+
(0, _mediaSingle.insertMediaSingleNode)(_this.view, mediaStateWithContext, _this.getInputMethod(pickerType), collection, _this.mediaOptions && _this.mediaOptions.alignLeftOnInsert, _this.newInsertionBehaviour, widthPluginState);
|
|
246
247
|
} else if ((0, _mediaCommon2.getMediaFeatureFlag)('mediaInline', (_this$mediaOptions2 = _this.mediaOptions) === null || _this$mediaOptions2 === void 0 ? void 0 : _this$mediaOptions2.featureFlags) && !(0, _document.isInEmptyLine)(state) && (!(0, _mediaCommon.isInsidePotentialEmptyParagraph)(state) || (0, _utils3.isInListItem)(state)) && (0, _mediaFiles.canInsertMediaInline)(state)) {
|
|
247
248
|
(0, _mediaFiles.insertMediaInlineNode)(_this.view, mediaStateWithContext, collection, _this.getInputMethod(pickerType));
|
|
248
249
|
} else {
|
|
@@ -483,7 +484,7 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
483
484
|
this.mediaOptions = mediaOptions;
|
|
484
485
|
this.newInsertionBehaviour = newInsertionBehaviour;
|
|
485
486
|
this.dispatch = _dispatch;
|
|
486
|
-
this.
|
|
487
|
+
this.pluginInjectionApi = pluginInjectionApi;
|
|
487
488
|
this.waitForMediaUpload = options.waitForMediaUpload === undefined ? true : options.waitForMediaUpload;
|
|
488
489
|
var nodes = _state.schema.nodes;
|
|
489
490
|
(0, _assert.default)(nodes.media && (nodes.mediaGroup || nodes.mediaSingle), 'Editor: unable to init media plugin - media or mediaGroup/mediaSingle node absent in schema');
|
|
@@ -219,7 +219,12 @@ var ResizableMediaSingleNext = /*#__PURE__*/function (_React$Component) {
|
|
|
219
219
|
var dom = view.dom;
|
|
220
220
|
var defaultGuidelines = this.getDefaultGuidelines();
|
|
221
221
|
// disable guidelines for nested media single node
|
|
222
|
-
var dynamicGuidelines = this.isNestedNode() ? [] : (0, _guideline.generateDynamicGuidelines)(view.state, lineLength
|
|
222
|
+
var dynamicGuidelines = this.isNestedNode() ? [] : (0, _guideline.generateDynamicGuidelines)(view.state, lineLength, {
|
|
223
|
+
styles: {
|
|
224
|
+
lineStyle: 'dashed'
|
|
225
|
+
},
|
|
226
|
+
show: false
|
|
227
|
+
});
|
|
223
228
|
var guidelines = [].concat((0, _toConsumableArray2.default)(defaultGuidelines), (0, _toConsumableArray2.default)(dynamicGuidelines));
|
|
224
229
|
var mediaSingleSelector = 'div.mediaSingleView-content-wrap.ProseMirror-selectednode';
|
|
225
230
|
var _dom$getBoundingClien = dom.getBoundingClientRect(),
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "187.13.
|
|
9
|
+
var version = "187.13.5";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
package/dist/cjs/version.json
CHANGED
|
@@ -46,7 +46,6 @@ const createDropPlaceholder = (intl, allowDropLine) => {
|
|
|
46
46
|
const MEDIA_RESOLVED_STATES = ['ready', 'error', 'cancelled'];
|
|
47
47
|
export class MediaPluginStateImplementation {
|
|
48
48
|
constructor(_state, options, mediaOptions, newInsertionBehaviour, _dispatch, pluginInjectionApi) {
|
|
49
|
-
var _pluginInjectionApi$d, _pluginInjectionApi$d2;
|
|
50
49
|
_defineProperty(this, "allowsUploads", false);
|
|
51
50
|
_defineProperty(this, "ignoreLinks", false);
|
|
52
51
|
_defineProperty(this, "waitForMediaUpload", true);
|
|
@@ -171,7 +170,10 @@ export class MediaPluginStateImplementation {
|
|
|
171
170
|
});
|
|
172
171
|
}
|
|
173
172
|
if (isMediaSingle(state.schema, mediaStateWithContext.fileMimeType)) {
|
|
174
|
-
|
|
173
|
+
var _this$pluginInjection;
|
|
174
|
+
// read width state right before inserting to get up-to-date and define values
|
|
175
|
+
const widthPluginState = (_this$pluginInjection = this.pluginInjectionApi) === null || _this$pluginInjection === void 0 ? void 0 : _this$pluginInjection.dependencies.width.sharedState.currentState();
|
|
176
|
+
insertMediaSingleNode(this.view, mediaStateWithContext, this.getInputMethod(pickerType), collection, this.mediaOptions && this.mediaOptions.alignLeftOnInsert, this.newInsertionBehaviour, widthPluginState);
|
|
175
177
|
} else if (getMediaFeatureFlag('mediaInline', (_this$mediaOptions2 = this.mediaOptions) === null || _this$mediaOptions2 === void 0 ? void 0 : _this$mediaOptions2.featureFlags) && !isInEmptyLine(state) && (!isInsidePotentialEmptyParagraph(state) || isInListItem(state)) && canInsertMediaInline(state)) {
|
|
176
178
|
insertMediaInlineNode(this.view, mediaStateWithContext, collection, this.getInputMethod(pickerType));
|
|
177
179
|
} else {
|
|
@@ -411,7 +413,7 @@ export class MediaPluginStateImplementation {
|
|
|
411
413
|
this.mediaOptions = mediaOptions;
|
|
412
414
|
this.newInsertionBehaviour = newInsertionBehaviour;
|
|
413
415
|
this.dispatch = _dispatch;
|
|
414
|
-
this.
|
|
416
|
+
this.pluginInjectionApi = pluginInjectionApi;
|
|
415
417
|
this.waitForMediaUpload = options.waitForMediaUpload === undefined ? true : options.waitForMediaUpload;
|
|
416
418
|
const {
|
|
417
419
|
nodes
|
|
@@ -197,7 +197,12 @@ class ResizableMediaSingleNext extends React.Component {
|
|
|
197
197
|
} = view;
|
|
198
198
|
const defaultGuidelines = this.getDefaultGuidelines();
|
|
199
199
|
// disable guidelines for nested media single node
|
|
200
|
-
const dynamicGuidelines = this.isNestedNode() ? [] : generateDynamicGuidelines(view.state, lineLength
|
|
200
|
+
const dynamicGuidelines = this.isNestedNode() ? [] : generateDynamicGuidelines(view.state, lineLength, {
|
|
201
|
+
styles: {
|
|
202
|
+
lineStyle: 'dashed'
|
|
203
|
+
},
|
|
204
|
+
show: false
|
|
205
|
+
});
|
|
201
206
|
const guidelines = [...defaultGuidelines, ...dynamicGuidelines];
|
|
202
207
|
const mediaSingleSelector = 'div.mediaSingleView-content-wrap.ProseMirror-selectednode';
|
|
203
208
|
const {
|
package/dist/es2019/version.json
CHANGED
|
@@ -55,9 +55,7 @@ var createDropPlaceholder = function createDropPlaceholder(intl, allowDropLine)
|
|
|
55
55
|
var MEDIA_RESOLVED_STATES = ['ready', 'error', 'cancelled'];
|
|
56
56
|
export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
57
57
|
function MediaPluginStateImplementation(_state, options, mediaOptions, newInsertionBehaviour, _dispatch, pluginInjectionApi) {
|
|
58
|
-
var _this = this
|
|
59
|
-
_pluginInjectionApi$d,
|
|
60
|
-
_pluginInjectionApi$d2;
|
|
58
|
+
var _this = this;
|
|
61
59
|
_classCallCheck(this, MediaPluginStateImplementation);
|
|
62
60
|
_defineProperty(this, "allowsUploads", false);
|
|
63
61
|
_defineProperty(this, "ignoreLinks", false);
|
|
@@ -226,7 +224,10 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
226
224
|
});
|
|
227
225
|
}
|
|
228
226
|
if (isMediaSingle(state.schema, mediaStateWithContext.fileMimeType)) {
|
|
229
|
-
|
|
227
|
+
var _this$pluginInjection;
|
|
228
|
+
// read width state right before inserting to get up-to-date and define values
|
|
229
|
+
var widthPluginState = (_this$pluginInjection = _this.pluginInjectionApi) === null || _this$pluginInjection === void 0 ? void 0 : _this$pluginInjection.dependencies.width.sharedState.currentState();
|
|
230
|
+
insertMediaSingleNode(_this.view, mediaStateWithContext, _this.getInputMethod(pickerType), collection, _this.mediaOptions && _this.mediaOptions.alignLeftOnInsert, _this.newInsertionBehaviour, widthPluginState);
|
|
230
231
|
} else if (getMediaFeatureFlag('mediaInline', (_this$mediaOptions2 = _this.mediaOptions) === null || _this$mediaOptions2 === void 0 ? void 0 : _this$mediaOptions2.featureFlags) && !isInEmptyLine(state) && (!isInsidePotentialEmptyParagraph(state) || isInListItem(state)) && canInsertMediaInline(state)) {
|
|
231
232
|
insertMediaInlineNode(_this.view, mediaStateWithContext, collection, _this.getInputMethod(pickerType));
|
|
232
233
|
} else {
|
|
@@ -467,7 +468,7 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
467
468
|
this.mediaOptions = mediaOptions;
|
|
468
469
|
this.newInsertionBehaviour = newInsertionBehaviour;
|
|
469
470
|
this.dispatch = _dispatch;
|
|
470
|
-
this.
|
|
471
|
+
this.pluginInjectionApi = pluginInjectionApi;
|
|
471
472
|
this.waitForMediaUpload = options.waitForMediaUpload === undefined ? true : options.waitForMediaUpload;
|
|
472
473
|
var nodes = _state.schema.nodes;
|
|
473
474
|
assert(nodes.media && (nodes.mediaGroup || nodes.mediaSingle), 'Editor: unable to init media plugin - media or mediaGroup/mediaSingle node absent in schema');
|
|
@@ -212,7 +212,12 @@ var ResizableMediaSingleNext = /*#__PURE__*/function (_React$Component) {
|
|
|
212
212
|
var dom = view.dom;
|
|
213
213
|
var defaultGuidelines = this.getDefaultGuidelines();
|
|
214
214
|
// disable guidelines for nested media single node
|
|
215
|
-
var dynamicGuidelines = this.isNestedNode() ? [] : generateDynamicGuidelines(view.state, lineLength
|
|
215
|
+
var dynamicGuidelines = this.isNestedNode() ? [] : generateDynamicGuidelines(view.state, lineLength, {
|
|
216
|
+
styles: {
|
|
217
|
+
lineStyle: 'dashed'
|
|
218
|
+
},
|
|
219
|
+
show: false
|
|
220
|
+
});
|
|
216
221
|
var guidelines = [].concat(_toConsumableArray(defaultGuidelines), _toConsumableArray(dynamicGuidelines));
|
|
217
222
|
var mediaSingleSelector = 'div.mediaSingleView-content-wrap.ProseMirror-selectednode';
|
|
218
223
|
var _dom$getBoundingClien = dom.getBoundingClientRect(),
|
package/dist/esm/version.json
CHANGED
|
@@ -5,7 +5,6 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
5
5
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
6
6
|
import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
|
|
7
7
|
import type { ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
8
|
-
import type { WidthPluginState } from '@atlaskit/editor-plugin-width';
|
|
9
8
|
import type { Dispatch } from '../../../event-dispatcher';
|
|
10
9
|
import type { ProsemirrorGetPosHandler } from '../../../nodeviews';
|
|
11
10
|
import type { MediaPluginOptions } from '../media-plugin-options';
|
|
@@ -52,8 +51,8 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
52
51
|
showEditingDialog?: boolean;
|
|
53
52
|
mediaOptions?: MediaOptions;
|
|
54
53
|
dispatch?: Dispatch;
|
|
55
|
-
|
|
56
|
-
constructor(state: EditorState, options: MediaPluginOptions, mediaOptions?: MediaOptions, newInsertionBehaviour?: boolean, dispatch?: Dispatch, pluginInjectionApi?: ExtractInjectionAPI<typeof mediaPlugin>
|
|
54
|
+
pluginInjectionApi?: ExtractInjectionAPI<typeof mediaPlugin>;
|
|
55
|
+
constructor(state: EditorState, options: MediaPluginOptions, mediaOptions?: MediaOptions, newInsertionBehaviour?: boolean, dispatch?: Dispatch, pluginInjectionApi?: ExtractInjectionAPI<typeof mediaPlugin>);
|
|
57
56
|
onContextIdentifierProvider: (_name: string, provider?: Promise<ContextIdentifierProvider>) => Promise<void>;
|
|
58
57
|
setMediaProvider: (mediaProvider?: Promise<MediaProvider>) => Promise<void>;
|
|
59
58
|
getMediaOptions: () => MediaPluginOptions;
|
|
@@ -113,4 +112,4 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
113
112
|
updateAndDispatch(props: Partial<Pick<this, 'allowsUploads' | 'allUploadsFinished' | 'isFullscreen'>>): void;
|
|
114
113
|
}
|
|
115
114
|
export declare const getMediaPluginState: (state: EditorState) => MediaPluginState;
|
|
116
|
-
export declare const createPlugin: (_schema: Schema, options: MediaPluginOptions, reactContext: () => {}, getIntl: () => IntlShape, dispatch?: Dispatch, mediaOptions?: MediaOptions, newInsertionBehaviour?: boolean, pluginInjectionApi?: ExtractInjectionAPI<typeof mediaPlugin>
|
|
115
|
+
export declare const createPlugin: (_schema: Schema, options: MediaPluginOptions, reactContext: () => {}, getIntl: () => IntlShape, dispatch?: Dispatch, mediaOptions?: MediaOptions, newInsertionBehaviour?: boolean, pluginInjectionApi?: ExtractInjectionAPI<typeof mediaPlugin>) => SafePlugin<MediaPluginState>;
|
|
@@ -5,7 +5,6 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
5
5
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
6
6
|
import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
|
|
7
7
|
import type { ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
8
|
-
import type { WidthPluginState } from '@atlaskit/editor-plugin-width';
|
|
9
8
|
import type { Dispatch } from '../../../event-dispatcher';
|
|
10
9
|
import type { ProsemirrorGetPosHandler } from '../../../nodeviews';
|
|
11
10
|
import type { MediaPluginOptions } from '../media-plugin-options';
|
|
@@ -52,8 +51,8 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
52
51
|
showEditingDialog?: boolean;
|
|
53
52
|
mediaOptions?: MediaOptions;
|
|
54
53
|
dispatch?: Dispatch;
|
|
55
|
-
|
|
56
|
-
constructor(state: EditorState, options: MediaPluginOptions, mediaOptions?: MediaOptions, newInsertionBehaviour?: boolean, dispatch?: Dispatch, pluginInjectionApi?: ExtractInjectionAPI<typeof mediaPlugin>
|
|
54
|
+
pluginInjectionApi?: ExtractInjectionAPI<typeof mediaPlugin>;
|
|
55
|
+
constructor(state: EditorState, options: MediaPluginOptions, mediaOptions?: MediaOptions, newInsertionBehaviour?: boolean, dispatch?: Dispatch, pluginInjectionApi?: ExtractInjectionAPI<typeof mediaPlugin>);
|
|
57
56
|
onContextIdentifierProvider: (_name: string, provider?: Promise<ContextIdentifierProvider>) => Promise<void>;
|
|
58
57
|
setMediaProvider: (mediaProvider?: Promise<MediaProvider>) => Promise<void>;
|
|
59
58
|
getMediaOptions: () => MediaPluginOptions;
|
|
@@ -113,4 +112,4 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
113
112
|
updateAndDispatch(props: Partial<Pick<this, 'allowsUploads' | 'allUploadsFinished' | 'isFullscreen'>>): void;
|
|
114
113
|
}
|
|
115
114
|
export declare const getMediaPluginState: (state: EditorState) => MediaPluginState;
|
|
116
|
-
export declare const createPlugin: (_schema: Schema, options: MediaPluginOptions, reactContext: () => {}, getIntl: () => IntlShape, dispatch?: Dispatch, mediaOptions?: MediaOptions, newInsertionBehaviour?: boolean, pluginInjectionApi?: ExtractInjectionAPI<typeof mediaPlugin>
|
|
115
|
+
export declare const createPlugin: (_schema: Schema, options: MediaPluginOptions, reactContext: () => {}, getIntl: () => IntlShape, dispatch?: Dispatch, mediaOptions?: MediaOptions, newInsertionBehaviour?: boolean, pluginInjectionApi?: ExtractInjectionAPI<typeof mediaPlugin>) => SafePlugin<MediaPluginState>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "187.13.
|
|
3
|
+
"version": "187.13.5",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@atlaskit/activity-provider": "^2.4.0",
|
|
43
|
-
"@atlaskit/adf-schema": "^
|
|
43
|
+
"@atlaskit/adf-schema": "^27.0.0",
|
|
44
44
|
"@atlaskit/adf-utils": "^19.0.0",
|
|
45
45
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
46
46
|
"@atlaskit/analytics-listeners": "^8.7.0",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"@atlaskit/radio": "^5.6.0",
|
|
98
98
|
"@atlaskit/section-message": "^6.4.0",
|
|
99
99
|
"@atlaskit/select": "^16.5.0",
|
|
100
|
-
"@atlaskit/smart-card": "^26.
|
|
100
|
+
"@atlaskit/smart-card": "^26.15.0",
|
|
101
101
|
"@atlaskit/smart-user-picker": "^6.1.0",
|
|
102
102
|
"@atlaskit/spinner": "^15.5.0",
|
|
103
103
|
"@atlaskit/status": "^1.3.0",
|