@atlaskit/editor-plugin-media 0.3.15 → 0.3.16
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 +9 -0
- package/dist/cjs/nodeviews/mediaSingle.js +3 -4
- package/dist/cjs/plugin.js +2 -8
- package/dist/cjs/pm-plugins/keymap.js +1 -4
- package/dist/es2019/nodeviews/mediaSingle.js +1 -2
- package/dist/es2019/plugin.js +2 -8
- package/dist/es2019/pm-plugins/keymap.js +1 -5
- package/dist/esm/nodeviews/mediaSingle.js +1 -2
- package/dist/esm/plugin.js +2 -8
- package/dist/esm/pm-plugins/keymap.js +1 -4
- package/package.json +10 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 0.3.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#43014](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43014) [`f021d31543e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f021d31543e) - create useFileState hook versions of header and itemviewer, create list-v2, refactor MediaFileStateError to media-client-react
|
|
8
|
+
- [#42702](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42702) [`79e5ed8fac7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/79e5ed8fac7) - ED-19543 remove unused FF check
|
|
9
|
+
- [#43014](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43014) [`761551f78ab`](https://bitbucket.org/atlassian/atlassian-frontend/commits/761551f78ab) - Implement useFileState hook on Media Viewer under Version 2
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 0.3.15
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -29,14 +29,13 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
29
29
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
30
30
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
31
31
|
var _mediaClient = require("@atlaskit/media-client");
|
|
32
|
-
var _mediaCommon = require("@atlaskit/media-common");
|
|
33
32
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
34
33
|
var _captions = require("../commands/captions");
|
|
35
34
|
var _main = require("../pm-plugins/main");
|
|
36
35
|
var _CaptionPlaceholder = _interopRequireDefault(require("../ui/CaptionPlaceholder"));
|
|
37
36
|
var _ResizableMediaSingle = _interopRequireDefault(require("../ui/ResizableMediaSingle"));
|
|
38
37
|
var _ResizableMediaSingleNext = _interopRequireDefault(require("../ui/ResizableMediaSingle/ResizableMediaSingleNext"));
|
|
39
|
-
var
|
|
38
|
+
var _mediaCommon = require("../utils/media-common");
|
|
40
39
|
var _helpers = require("./helpers");
|
|
41
40
|
var _mediaNodeUpdater = require("./mediaNodeUpdater");
|
|
42
41
|
var _styles = require("./styles");
|
|
@@ -349,7 +348,7 @@ var MediaSingleNode = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
349
348
|
var width = attrs.width,
|
|
350
349
|
height = attrs.height;
|
|
351
350
|
if (attrs.type === 'external') {
|
|
352
|
-
if ((0,
|
|
351
|
+
if ((0, _mediaCommon.isMediaBlobUrlFromAttrs)(attrs)) {
|
|
353
352
|
var urlAttrs = (0, _mediaClient.getAttrsFromUrl)(attrs.url);
|
|
354
353
|
if (urlAttrs) {
|
|
355
354
|
var urlWidth = urlAttrs.width,
|
|
@@ -419,7 +418,7 @@ var MediaSingleNode = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
419
418
|
canResize = canResize && !disabledNode;
|
|
420
419
|
}
|
|
421
420
|
}
|
|
422
|
-
var shouldShowPlaceholder =
|
|
421
|
+
var shouldShowPlaceholder = mediaOptions.allowCaptions && node.childCount !== 2 && isSelected && state.selection instanceof _state.NodeSelection;
|
|
423
422
|
var MediaChildren = (0, _react2.jsx)("figure", {
|
|
424
423
|
ref: this.mediaSingleWrapperRef,
|
|
425
424
|
css: [_styles.figureWrapper],
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -81,17 +81,11 @@ var mediaPlugin = exports.mediaPlugin = function mediaPlugin(_ref2) {
|
|
|
81
81
|
allowCaptions = _ref3.allowCaptions,
|
|
82
82
|
mediaFeatureFlags = _ref3.featureFlags;
|
|
83
83
|
var allowMediaInline = (0, _mediaCommon.getMediaFeatureFlag)('mediaInline', mediaFeatureFlags);
|
|
84
|
-
var withCaption = (0, _mediaCommon.getMediaFeatureFlag)('captions', mediaFeatureFlags);
|
|
85
|
-
|
|
86
|
-
// temporary mapping - we will support captions feature flag until
|
|
87
|
-
// confluence removes the feature flag support in their code base and
|
|
88
|
-
// utilizes allowCaptions media prop instead
|
|
89
|
-
var mappedAllowCaptions = allowCaptions ? allowCaptions : withCaption;
|
|
90
84
|
var mediaSingleOption = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.media.extended-resize-experience') ? {
|
|
91
|
-
withCaption:
|
|
85
|
+
withCaption: allowCaptions,
|
|
92
86
|
withExtendedWidthTypes: true
|
|
93
87
|
} : {
|
|
94
|
-
withCaption:
|
|
88
|
+
withCaption: allowCaptions,
|
|
95
89
|
withExtendedWidthTypes: false
|
|
96
90
|
};
|
|
97
91
|
var mediaSingleNode = (0, _adfSchema.mediaSingleSpec)(mediaSingleOption);
|
|
@@ -9,16 +9,13 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
|
9
9
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
10
10
|
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
11
11
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
12
|
-
var _mediaCommon = require("@atlaskit/media-common");
|
|
13
12
|
var _captions = require("../commands/captions");
|
|
14
13
|
var _pluginKey = require("../pm-plugins/plugin-key");
|
|
15
14
|
function keymapPlugin(options, editorAnalyticsAPI, editorSelectionAPI) {
|
|
16
15
|
var list = {};
|
|
17
|
-
var _ref = options || {},
|
|
18
|
-
featureFlags = _ref.featureFlags;
|
|
19
16
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.undo.common, ignoreLinksInSteps, list);
|
|
20
17
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.enter.common, splitMediaGroup, list);
|
|
21
|
-
if (options !== null && options !== void 0 && options.allowCaptions
|
|
18
|
+
if (options !== null && options !== void 0 && options.allowCaptions) {
|
|
22
19
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveDown.common, insertAndSelectCaption(editorAnalyticsAPI), list);
|
|
23
20
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.tab.common, insertAndSelectCaption(editorAnalyticsAPI), list);
|
|
24
21
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveLeft.common, arrowLeftFromMediaSingle(editorSelectionAPI), list);
|
|
@@ -14,7 +14,6 @@ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
14
14
|
import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
15
15
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
16
16
|
import { getAttrsFromUrl } from '@atlaskit/media-client';
|
|
17
|
-
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
18
17
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
19
18
|
import { insertAndSelectCaptionFromMediaSinglePos } from '../commands/captions';
|
|
20
19
|
import { MEDIA_CONTENT_WRAP_CLASS_NAME } from '../pm-plugins/main';
|
|
@@ -332,7 +331,7 @@ export default class MediaSingleNode extends Component {
|
|
|
332
331
|
canResize = canResize && !disabledNode;
|
|
333
332
|
}
|
|
334
333
|
}
|
|
335
|
-
const shouldShowPlaceholder =
|
|
334
|
+
const shouldShowPlaceholder = mediaOptions.allowCaptions && node.childCount !== 2 && isSelected && state.selection instanceof NodeSelection;
|
|
336
335
|
const MediaChildren = jsx("figure", {
|
|
337
336
|
ref: this.mediaSingleWrapperRef,
|
|
338
337
|
css: [figureWrapper],
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -71,17 +71,11 @@ export const mediaPlugin = ({
|
|
|
71
71
|
featureFlags: mediaFeatureFlags
|
|
72
72
|
} = options || {};
|
|
73
73
|
const allowMediaInline = getMediaFeatureFlag('mediaInline', mediaFeatureFlags);
|
|
74
|
-
const withCaption = getMediaFeatureFlag('captions', mediaFeatureFlags);
|
|
75
|
-
|
|
76
|
-
// temporary mapping - we will support captions feature flag until
|
|
77
|
-
// confluence removes the feature flag support in their code base and
|
|
78
|
-
// utilizes allowCaptions media prop instead
|
|
79
|
-
const mappedAllowCaptions = allowCaptions ? allowCaptions : withCaption;
|
|
80
74
|
const mediaSingleOption = getBooleanFF('platform.editor.media.extended-resize-experience') ? {
|
|
81
|
-
withCaption:
|
|
75
|
+
withCaption: allowCaptions,
|
|
82
76
|
withExtendedWidthTypes: true
|
|
83
77
|
} : {
|
|
84
|
-
withCaption:
|
|
78
|
+
withCaption: allowCaptions,
|
|
85
79
|
withExtendedWidthTypes: false
|
|
86
80
|
};
|
|
87
81
|
const mediaSingleNode = mediaSingleSpec(mediaSingleOption);
|
|
@@ -2,17 +2,13 @@ import { bindKeymapWithCommand, enter, insertNewLine, moveDown, moveLeft, moveRi
|
|
|
2
2
|
import { GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
|
|
3
3
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
4
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
6
5
|
import { insertAndSelectCaptionFromMediaSinglePos, selectCaptionFromMediaSinglePos } from '../commands/captions';
|
|
7
6
|
import { stateKey } from '../pm-plugins/plugin-key';
|
|
8
7
|
export function keymapPlugin(options, editorAnalyticsAPI, editorSelectionAPI) {
|
|
9
8
|
const list = {};
|
|
10
|
-
const {
|
|
11
|
-
featureFlags
|
|
12
|
-
} = options || {};
|
|
13
9
|
bindKeymapWithCommand(undo.common, ignoreLinksInSteps, list);
|
|
14
10
|
bindKeymapWithCommand(enter.common, splitMediaGroup, list);
|
|
15
|
-
if (options !== null && options !== void 0 && options.allowCaptions
|
|
11
|
+
if (options !== null && options !== void 0 && options.allowCaptions) {
|
|
16
12
|
bindKeymapWithCommand(moveDown.common, insertAndSelectCaption(editorAnalyticsAPI), list);
|
|
17
13
|
bindKeymapWithCommand(tab.common, insertAndSelectCaption(editorAnalyticsAPI), list);
|
|
18
14
|
bindKeymapWithCommand(moveLeft.common, arrowLeftFromMediaSingle(editorSelectionAPI), list);
|
|
@@ -27,7 +27,6 @@ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
27
27
|
import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
28
28
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
29
29
|
import { getAttrsFromUrl } from '@atlaskit/media-client';
|
|
30
|
-
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
31
30
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
32
31
|
import { insertAndSelectCaptionFromMediaSinglePos } from '../commands/captions';
|
|
33
32
|
import { MEDIA_CONTENT_WRAP_CLASS_NAME } from '../pm-plugins/main';
|
|
@@ -411,7 +410,7 @@ var MediaSingleNode = /*#__PURE__*/function (_Component) {
|
|
|
411
410
|
canResize = canResize && !disabledNode;
|
|
412
411
|
}
|
|
413
412
|
}
|
|
414
|
-
var shouldShowPlaceholder =
|
|
413
|
+
var shouldShowPlaceholder = mediaOptions.allowCaptions && node.childCount !== 2 && isSelected && state.selection instanceof NodeSelection;
|
|
415
414
|
var MediaChildren = jsx("figure", {
|
|
416
415
|
ref: this.mediaSingleWrapperRef,
|
|
417
416
|
css: [figureWrapper],
|
package/dist/esm/plugin.js
CHANGED
|
@@ -70,17 +70,11 @@ export var mediaPlugin = function mediaPlugin(_ref2) {
|
|
|
70
70
|
allowCaptions = _ref3.allowCaptions,
|
|
71
71
|
mediaFeatureFlags = _ref3.featureFlags;
|
|
72
72
|
var allowMediaInline = getMediaFeatureFlag('mediaInline', mediaFeatureFlags);
|
|
73
|
-
var withCaption = getMediaFeatureFlag('captions', mediaFeatureFlags);
|
|
74
|
-
|
|
75
|
-
// temporary mapping - we will support captions feature flag until
|
|
76
|
-
// confluence removes the feature flag support in their code base and
|
|
77
|
-
// utilizes allowCaptions media prop instead
|
|
78
|
-
var mappedAllowCaptions = allowCaptions ? allowCaptions : withCaption;
|
|
79
73
|
var mediaSingleOption = getBooleanFF('platform.editor.media.extended-resize-experience') ? {
|
|
80
|
-
withCaption:
|
|
74
|
+
withCaption: allowCaptions,
|
|
81
75
|
withExtendedWidthTypes: true
|
|
82
76
|
} : {
|
|
83
|
-
withCaption:
|
|
77
|
+
withCaption: allowCaptions,
|
|
84
78
|
withExtendedWidthTypes: false
|
|
85
79
|
};
|
|
86
80
|
var mediaSingleNode = mediaSingleSpec(mediaSingleOption);
|
|
@@ -2,16 +2,13 @@ import { bindKeymapWithCommand, enter, insertNewLine, moveDown, moveLeft, moveRi
|
|
|
2
2
|
import { GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
|
|
3
3
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
4
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
6
5
|
import { insertAndSelectCaptionFromMediaSinglePos, selectCaptionFromMediaSinglePos } from '../commands/captions';
|
|
7
6
|
import { stateKey } from '../pm-plugins/plugin-key';
|
|
8
7
|
export function keymapPlugin(options, editorAnalyticsAPI, editorSelectionAPI) {
|
|
9
8
|
var list = {};
|
|
10
|
-
var _ref = options || {},
|
|
11
|
-
featureFlags = _ref.featureFlags;
|
|
12
9
|
bindKeymapWithCommand(undo.common, ignoreLinksInSteps, list);
|
|
13
10
|
bindKeymapWithCommand(enter.common, splitMediaGroup, list);
|
|
14
|
-
if (options !== null && options !== void 0 && options.allowCaptions
|
|
11
|
+
if (options !== null && options !== void 0 && options.allowCaptions) {
|
|
15
12
|
bindKeymapWithCommand(moveDown.common, insertAndSelectCaption(editorAnalyticsAPI), list);
|
|
16
13
|
bindKeymapWithCommand(tab.common, insertAndSelectCaption(editorAnalyticsAPI), list);
|
|
17
14
|
bindKeymapWithCommand(moveLeft.common, arrowLeftFromMediaSingle(editorSelectionAPI), list);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.16",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@atlaskit/adf-schema": "^32.0.0",
|
|
36
36
|
"@atlaskit/analytics-namespaced-context": "^6.7.0",
|
|
37
37
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
38
|
-
"@atlaskit/button": "^16.
|
|
38
|
+
"@atlaskit/button": "^16.15.0",
|
|
39
39
|
"@atlaskit/editor-common": "^76.18.0",
|
|
40
40
|
"@atlaskit/editor-palette": "1.5.2",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^0.3.0",
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
"@atlaskit/editor-tables": "^2.3.0",
|
|
54
54
|
"@atlaskit/form": "^9.0.0",
|
|
55
55
|
"@atlaskit/icon": "^21.12.0",
|
|
56
|
-
"@atlaskit/media-card": "^77.
|
|
56
|
+
"@atlaskit/media-card": "^77.4.0",
|
|
57
57
|
"@atlaskit/media-client": "^25.0.0",
|
|
58
|
-
"@atlaskit/media-client-react": "^1.
|
|
59
|
-
"@atlaskit/media-common": "^
|
|
58
|
+
"@atlaskit/media-client-react": "^1.4.0",
|
|
59
|
+
"@atlaskit/media-common": "^11.0.0",
|
|
60
60
|
"@atlaskit/media-filmstrip": "^47.0.0",
|
|
61
61
|
"@atlaskit/media-picker": "^66.2.0",
|
|
62
62
|
"@atlaskit/media-ui": "^25.0.0",
|
|
63
|
-
"@atlaskit/media-viewer": "^48.
|
|
63
|
+
"@atlaskit/media-viewer": "^48.2.0",
|
|
64
64
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
65
65
|
"@atlaskit/textfield": "^5.6.0",
|
|
66
66
|
"@atlaskit/theme": "^12.6.0",
|
|
@@ -133,6 +133,10 @@
|
|
|
133
133
|
},
|
|
134
134
|
"platform.editor.media.inline-image.base-support": {
|
|
135
135
|
"type": "boolean"
|
|
136
|
+
},
|
|
137
|
+
"platform.media-experience.media-viewer-v2_hgsii": {
|
|
138
|
+
"type": "boolean",
|
|
139
|
+
"referenceOnly": "true"
|
|
136
140
|
}
|
|
137
141
|
},
|
|
138
142
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|