@atlaskit/editor-plugin-caption 1.11.7 → 1.11.9
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 +12 -0
- package/dist/cjs/nodeviews/index.js +8 -9
- package/dist/cjs/pm-plugins/keymap.js +23 -0
- package/dist/cjs/pm-plugins/main.js +4 -1
- package/dist/es2019/index.js +3 -0
- package/dist/es2019/nodeviews/index.js +2 -0
- package/dist/es2019/pm-plugins/keymap.js +23 -0
- package/dist/es2019/pm-plugins/main.js +4 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/nodeviews/index.js +8 -9
- package/dist/esm/pm-plugins/keymap.js +23 -0
- package/dist/esm/pm-plugins/main.js +4 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -8,29 +8,29 @@ exports.CaptionNodeView = void 0;
|
|
|
8
8
|
exports.default = captionNodeView;
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
15
|
var _react = _interopRequireDefault(require("react"));
|
|
17
16
|
var _selectionBasedNodeView = require("@atlaskit/editor-common/selection-based-node-view");
|
|
18
17
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
19
|
-
function
|
|
18
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
20
19
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
20
|
var CaptionNodeView = exports.CaptionNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
// Ignored via go/ees005
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
24
23
|
function CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, viewShouldUpdate, pluginInjectionApi) {
|
|
25
24
|
var _this;
|
|
26
25
|
(0, _classCallCheck2.default)(this, CaptionNodeView);
|
|
27
|
-
_this =
|
|
28
|
-
(0, _defineProperty2.default)(
|
|
26
|
+
_this = _callSuper(this, CaptionNodeView, [node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, viewShouldUpdate]);
|
|
27
|
+
(0, _defineProperty2.default)(_this, "selected", _this.insideSelection());
|
|
29
28
|
_this.pluginInjectionApi = pluginInjectionApi;
|
|
30
29
|
_this.handleEditorDisabledChanged();
|
|
31
30
|
return _this;
|
|
32
31
|
}
|
|
33
|
-
(0,
|
|
32
|
+
(0, _inherits2.default)(CaptionNodeView, _SelectionBasedNodeVi);
|
|
33
|
+
return (0, _createClass2.default)(CaptionNodeView, [{
|
|
34
34
|
key: "createDomRef",
|
|
35
35
|
value: function createDomRef() {
|
|
36
36
|
var domRef = document.createElement('figcaption');
|
|
@@ -104,7 +104,6 @@ var CaptionNodeView = exports.CaptionNodeView = /*#__PURE__*/function (_Selectio
|
|
|
104
104
|
this.cleanupEditorDisabledListener = undefined;
|
|
105
105
|
}
|
|
106
106
|
}]);
|
|
107
|
-
return CaptionNodeView;
|
|
108
107
|
}(_selectionBasedNodeView.SelectionBasedNodeView);
|
|
109
108
|
function captionNodeView(portalProviderAPI, eventDispatcher, pluginInjectionApi) {
|
|
110
109
|
return function (node, view, getPos) {
|
|
@@ -12,13 +12,36 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
12
12
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
13
13
|
function captionKeymap() {
|
|
14
14
|
var list = {};
|
|
15
|
+
|
|
16
|
+
// Ignored via go/ees005
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
15
18
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveDown.common, createNewParagraphBelowCaption, list);
|
|
19
|
+
// Ignored via go/ees005
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
16
21
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.enter.common, createNewParagraphBelowCaption, list);
|
|
22
|
+
|
|
23
|
+
// Ignored via go/ees005
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
17
25
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveDown.common, getOutOfCaption, list);
|
|
26
|
+
|
|
27
|
+
// Ignored via go/ees005
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
18
29
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.enter.common, getOutOfCaption, list);
|
|
30
|
+
|
|
31
|
+
// Ignored via go/ees005
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
19
33
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveUp.common, selectParentMediaSingle, list);
|
|
34
|
+
|
|
35
|
+
// Ignored via go/ees005
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
20
37
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.shiftTab.common, selectParentMediaSingle, list);
|
|
38
|
+
|
|
39
|
+
// Ignored via go/ees005
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
21
41
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.tab.common, getOutOfCaption, list);
|
|
42
|
+
|
|
43
|
+
// Ignored via go/ees005
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
22
45
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveLeft.common, gapCursorSelectLeftParentMediaSingle, list);
|
|
23
46
|
return (0, _keymap.keymap)(list);
|
|
24
47
|
}
|
|
@@ -18,7 +18,10 @@ var fireAnalytics = function fireAnalytics(tr, action, analyticsApi) {
|
|
|
18
18
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.CAPTION
|
|
19
19
|
})(tr);
|
|
20
20
|
};
|
|
21
|
-
var _default = exports.default = function _default(portalProviderAPI, eventDispatcher, providerFactory, dispatch, pluginInjectionApi
|
|
21
|
+
var _default = exports.default = function _default(portalProviderAPI, eventDispatcher, providerFactory, dispatch, pluginInjectionApi
|
|
22
|
+
// Ignored via go/ees005
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
24
|
+
) {
|
|
22
25
|
var _pluginInjectionApi$a;
|
|
23
26
|
var analyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
|
|
24
27
|
return new _safePlugin.SafePlugin({
|
package/dist/es2019/index.js
CHANGED
|
@@ -3,6 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
4
4
|
import { Caption } from '@atlaskit/editor-common/ui';
|
|
5
5
|
export class CaptionNodeView extends SelectionBasedNodeView {
|
|
6
|
+
// Ignored via go/ees005
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
6
8
|
constructor(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, viewShouldUpdate, pluginInjectionApi) {
|
|
7
9
|
super(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, viewShouldUpdate);
|
|
8
10
|
_defineProperty(this, "selected", this.insideSelection());
|
|
@@ -6,13 +6,36 @@ import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
|
6
6
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
7
7
|
export function captionKeymap() {
|
|
8
8
|
const list = {};
|
|
9
|
+
|
|
10
|
+
// Ignored via go/ees005
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9
12
|
bindKeymapWithCommand(moveDown.common, createNewParagraphBelowCaption, list);
|
|
13
|
+
// Ignored via go/ees005
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
10
15
|
bindKeymapWithCommand(enter.common, createNewParagraphBelowCaption, list);
|
|
16
|
+
|
|
17
|
+
// Ignored via go/ees005
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11
19
|
bindKeymapWithCommand(moveDown.common, getOutOfCaption, list);
|
|
20
|
+
|
|
21
|
+
// Ignored via go/ees005
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
12
23
|
bindKeymapWithCommand(enter.common, getOutOfCaption, list);
|
|
24
|
+
|
|
25
|
+
// Ignored via go/ees005
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
13
27
|
bindKeymapWithCommand(moveUp.common, selectParentMediaSingle, list);
|
|
28
|
+
|
|
29
|
+
// Ignored via go/ees005
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
14
31
|
bindKeymapWithCommand(shiftTab.common, selectParentMediaSingle, list);
|
|
32
|
+
|
|
33
|
+
// Ignored via go/ees005
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
15
35
|
bindKeymapWithCommand(tab.common, getOutOfCaption, list);
|
|
36
|
+
|
|
37
|
+
// Ignored via go/ees005
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
16
39
|
bindKeymapWithCommand(moveLeft.common, gapCursorSelectLeftParentMediaSingle, list);
|
|
17
40
|
return keymap(list);
|
|
18
41
|
}
|
|
@@ -11,7 +11,10 @@ const fireAnalytics = (tr, action, analyticsApi) => {
|
|
|
11
11
|
actionSubjectId: ACTION_SUBJECT_ID.CAPTION
|
|
12
12
|
})(tr);
|
|
13
13
|
};
|
|
14
|
-
export default ((portalProviderAPI, eventDispatcher, providerFactory, dispatch, pluginInjectionApi
|
|
14
|
+
export default ((portalProviderAPI, eventDispatcher, providerFactory, dispatch, pluginInjectionApi
|
|
15
|
+
// Ignored via go/ees005
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
17
|
+
) => {
|
|
15
18
|
var _pluginInjectionApi$a;
|
|
16
19
|
const analyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
|
|
17
20
|
return new SafePlugin({
|
package/dist/esm/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
9
|
import React from 'react';
|
|
11
10
|
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
12
11
|
import { Caption } from '@atlaskit/editor-common/ui';
|
|
13
12
|
export var CaptionNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
// Ignored via go/ees005
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
16
15
|
function CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, viewShouldUpdate, pluginInjectionApi) {
|
|
17
16
|
var _this;
|
|
18
17
|
_classCallCheck(this, CaptionNodeView);
|
|
19
|
-
_this =
|
|
20
|
-
_defineProperty(
|
|
18
|
+
_this = _callSuper(this, CaptionNodeView, [node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, viewShouldUpdate]);
|
|
19
|
+
_defineProperty(_this, "selected", _this.insideSelection());
|
|
21
20
|
_this.pluginInjectionApi = pluginInjectionApi;
|
|
22
21
|
_this.handleEditorDisabledChanged();
|
|
23
22
|
return _this;
|
|
24
23
|
}
|
|
25
|
-
|
|
24
|
+
_inherits(CaptionNodeView, _SelectionBasedNodeVi);
|
|
25
|
+
return _createClass(CaptionNodeView, [{
|
|
26
26
|
key: "createDomRef",
|
|
27
27
|
value: function createDomRef() {
|
|
28
28
|
var domRef = document.createElement('figcaption');
|
|
@@ -96,7 +96,6 @@ export var CaptionNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
96
96
|
this.cleanupEditorDisabledListener = undefined;
|
|
97
97
|
}
|
|
98
98
|
}]);
|
|
99
|
-
return CaptionNodeView;
|
|
100
99
|
}(SelectionBasedNodeView);
|
|
101
100
|
export default function captionNodeView(portalProviderAPI, eventDispatcher, pluginInjectionApi) {
|
|
102
101
|
return function (node, view, getPos) {
|
|
@@ -6,13 +6,36 @@ import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
|
6
6
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
7
7
|
export function captionKeymap() {
|
|
8
8
|
var list = {};
|
|
9
|
+
|
|
10
|
+
// Ignored via go/ees005
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9
12
|
bindKeymapWithCommand(moveDown.common, createNewParagraphBelowCaption, list);
|
|
13
|
+
// Ignored via go/ees005
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
10
15
|
bindKeymapWithCommand(enter.common, createNewParagraphBelowCaption, list);
|
|
16
|
+
|
|
17
|
+
// Ignored via go/ees005
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11
19
|
bindKeymapWithCommand(moveDown.common, getOutOfCaption, list);
|
|
20
|
+
|
|
21
|
+
// Ignored via go/ees005
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
12
23
|
bindKeymapWithCommand(enter.common, getOutOfCaption, list);
|
|
24
|
+
|
|
25
|
+
// Ignored via go/ees005
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
13
27
|
bindKeymapWithCommand(moveUp.common, selectParentMediaSingle, list);
|
|
28
|
+
|
|
29
|
+
// Ignored via go/ees005
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
14
31
|
bindKeymapWithCommand(shiftTab.common, selectParentMediaSingle, list);
|
|
32
|
+
|
|
33
|
+
// Ignored via go/ees005
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
15
35
|
bindKeymapWithCommand(tab.common, getOutOfCaption, list);
|
|
36
|
+
|
|
37
|
+
// Ignored via go/ees005
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
16
39
|
bindKeymapWithCommand(moveLeft.common, gapCursorSelectLeftParentMediaSingle, list);
|
|
17
40
|
return keymap(list);
|
|
18
41
|
}
|
|
@@ -11,7 +11,10 @@ var fireAnalytics = function fireAnalytics(tr, action, analyticsApi) {
|
|
|
11
11
|
actionSubjectId: ACTION_SUBJECT_ID.CAPTION
|
|
12
12
|
})(tr);
|
|
13
13
|
};
|
|
14
|
-
export default (function (portalProviderAPI, eventDispatcher, providerFactory, dispatch, pluginInjectionApi
|
|
14
|
+
export default (function (portalProviderAPI, eventDispatcher, providerFactory, dispatch, pluginInjectionApi
|
|
15
|
+
// Ignored via go/ees005
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
17
|
+
) {
|
|
15
18
|
var _pluginInjectionApi$a;
|
|
16
19
|
var analyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
|
|
17
20
|
return new SafePlugin({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-caption",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.9",
|
|
4
4
|
"description": "Caption plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
35
|
-
"@atlaskit/editor-common": "^
|
|
35
|
+
"@atlaskit/editor-common": "^98.0.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
37
37
|
"@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"@atlaskit/editor-plugin-focus": "^1.4.0",
|
|
47
47
|
"@atlaskit/editor-plugin-grid": "^1.2.0",
|
|
48
48
|
"@atlaskit/editor-plugin-guideline": "^1.2.0",
|
|
49
|
-
"@atlaskit/editor-plugin-selection": "^1.
|
|
50
|
-
"@atlaskit/editor-plugin-width": "^
|
|
51
|
-
"@atlaskit/renderer": "^112.
|
|
49
|
+
"@atlaskit/editor-plugin-selection": "^1.6.0",
|
|
50
|
+
"@atlaskit/editor-plugin-width": "^2.0.0",
|
|
51
|
+
"@atlaskit/renderer": "^112.8.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"react": "^16.8.0 || ^17.0.0 || ~18.2.0"
|