@atlaskit/editor-plugin-caption 1.1.1 → 1.1.3
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 +37 -6
- package/dist/es2019/nodeviews/index.js +28 -3
- package/dist/esm/nodeviews/index.js +37 -6
- package/dist/types/nodeviews/index.d.ts +7 -2
- package/dist/types/types.d.ts +6 -2
- package/dist/types-ts4.5/nodeviews/index.d.ts +7 -2
- package/dist/types-ts4.5/types.d.ts +4 -2
- package/package.json +13 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-caption
|
|
2
2
|
|
|
3
|
+
## 1.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#94413](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94413) [`6fa79788f5a8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6fa79788f5a8) - Disallow editing of Media caption in live view mode
|
|
8
|
+
|
|
9
|
+
## 1.1.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#94901](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94901) [`da964fcdc828`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/da964fcdc828) - [ED-23097] Bump ADF schema to version 35.12.1
|
|
14
|
+
|
|
3
15
|
## 1.1.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -16,19 +16,25 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
17
|
var _selectionBasedNodeView = require("@atlaskit/editor-common/selection-based-node-view");
|
|
18
18
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
19
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
20
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
20
21
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
22
|
var CaptionNodeView = exports.CaptionNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
22
23
|
(0, _inherits2.default)(CaptionNodeView, _SelectionBasedNodeVi);
|
|
23
24
|
var _super = _createSuper(CaptionNodeView);
|
|
24
|
-
function CaptionNodeView() {
|
|
25
|
+
function CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent) {
|
|
25
26
|
var _this;
|
|
27
|
+
var hasContext = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
|
|
28
|
+
var viewShouldUpdate = arguments.length > 8 ? arguments[8] : undefined;
|
|
29
|
+
var hasIntlContext = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
|
|
30
|
+
var pluginInjectionApi = arguments.length > 10 ? arguments[10] : undefined;
|
|
26
31
|
(0, _classCallCheck2.default)(this, CaptionNodeView);
|
|
27
|
-
|
|
28
|
-
args[_key] = arguments[_key];
|
|
29
|
-
}
|
|
30
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
32
|
+
_this = _super.call(this, node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, hasContext, viewShouldUpdate, hasIntlContext);
|
|
31
33
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "selected", _this.insideSelection());
|
|
34
|
+
_this.pluginInjectionApi = pluginInjectionApi;
|
|
35
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.live-view.disable-editing-in-view-mode_fi1rx')) {
|
|
36
|
+
_this.handleEditorDisabledChanged();
|
|
37
|
+
}
|
|
32
38
|
return _this;
|
|
33
39
|
}
|
|
34
40
|
(0, _createClass2.default)(CaptionNodeView, [{
|
|
@@ -45,10 +51,27 @@ var CaptionNodeView = exports.CaptionNodeView = /*#__PURE__*/function (_Selectio
|
|
|
45
51
|
// setting a className prevents PM/Chrome mutation observer from
|
|
46
52
|
// incorrectly deleting nodes
|
|
47
53
|
dom.className = 'caption-wrapper';
|
|
54
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.live-view.disable-editing-in-view-mode_fi1rx')) {
|
|
55
|
+
var _this$pluginInjection;
|
|
56
|
+
dom.setAttribute('contenteditable', (_this$pluginInjection = this.pluginInjectionApi) !== null && _this$pluginInjection !== void 0 && (_this$pluginInjection = _this$pluginInjection.editorDisabled) !== null && _this$pluginInjection !== void 0 && (_this$pluginInjection = _this$pluginInjection.sharedState.currentState()) !== null && _this$pluginInjection !== void 0 && _this$pluginInjection.editorDisabled ? 'false' : 'true');
|
|
57
|
+
}
|
|
48
58
|
return {
|
|
49
59
|
dom: dom
|
|
50
60
|
};
|
|
51
61
|
}
|
|
62
|
+
}, {
|
|
63
|
+
key: "handleEditorDisabledChanged",
|
|
64
|
+
value: function handleEditorDisabledChanged() {
|
|
65
|
+
var _this$pluginInjection2,
|
|
66
|
+
_this2 = this;
|
|
67
|
+
if ((_this$pluginInjection2 = this.pluginInjectionApi) !== null && _this$pluginInjection2 !== void 0 && _this$pluginInjection2.editorDisabled) {
|
|
68
|
+
this.cleanupEditorDisabledListener = this.pluginInjectionApi.editorDisabled.sharedState.onChange(function (sharedState) {
|
|
69
|
+
if (_this2.contentDOM) {
|
|
70
|
+
_this2.contentDOM.setAttribute('contenteditable', sharedState.nextSharedState.editorDisabled ? 'false' : 'true');
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
52
75
|
}, {
|
|
53
76
|
key: "render",
|
|
54
77
|
value: function render(_props, forwardRef) {
|
|
@@ -70,12 +93,20 @@ var CaptionNodeView = exports.CaptionNodeView = /*#__PURE__*/function (_Selectio
|
|
|
70
93
|
this.selected = newSelected;
|
|
71
94
|
return selectedStateChange;
|
|
72
95
|
}
|
|
96
|
+
}, {
|
|
97
|
+
key: "destroy",
|
|
98
|
+
value: function destroy() {
|
|
99
|
+
if (this.cleanupEditorDisabledListener) {
|
|
100
|
+
this.cleanupEditorDisabledListener();
|
|
101
|
+
}
|
|
102
|
+
this.cleanupEditorDisabledListener = undefined;
|
|
103
|
+
}
|
|
73
104
|
}]);
|
|
74
105
|
return CaptionNodeView;
|
|
75
106
|
}(_selectionBasedNodeView.SelectionBasedNodeView);
|
|
76
107
|
function captionNodeView(portalProviderAPI, eventDispatcher, pluginInjectionApi) {
|
|
77
108
|
return function (node, view, getPos) {
|
|
78
109
|
var hasIntlContext = true;
|
|
79
|
-
return new CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {}, undefined, undefined, undefined, hasIntlContext).init();
|
|
110
|
+
return new CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {}, undefined, undefined, undefined, hasIntlContext, pluginInjectionApi).init();
|
|
80
111
|
};
|
|
81
112
|
}
|
|
@@ -2,10 +2,15 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
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
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
export class CaptionNodeView extends SelectionBasedNodeView {
|
|
6
|
-
constructor(
|
|
7
|
-
super(
|
|
7
|
+
constructor(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, hasContext = false, viewShouldUpdate, hasIntlContext = false, pluginInjectionApi) {
|
|
8
|
+
super(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, hasContext, viewShouldUpdate, hasIntlContext);
|
|
8
9
|
_defineProperty(this, "selected", this.insideSelection());
|
|
10
|
+
this.pluginInjectionApi = pluginInjectionApi;
|
|
11
|
+
if (getBooleanFF('platform.editor.live-view.disable-editing-in-view-mode_fi1rx')) {
|
|
12
|
+
this.handleEditorDisabledChanged();
|
|
13
|
+
}
|
|
9
14
|
}
|
|
10
15
|
createDomRef() {
|
|
11
16
|
const domRef = document.createElement('figcaption');
|
|
@@ -17,10 +22,24 @@ export class CaptionNodeView extends SelectionBasedNodeView {
|
|
|
17
22
|
// setting a className prevents PM/Chrome mutation observer from
|
|
18
23
|
// incorrectly deleting nodes
|
|
19
24
|
dom.className = 'caption-wrapper';
|
|
25
|
+
if (getBooleanFF('platform.editor.live-view.disable-editing-in-view-mode_fi1rx')) {
|
|
26
|
+
var _this$pluginInjection, _this$pluginInjection2, _this$pluginInjection3;
|
|
27
|
+
dom.setAttribute('contenteditable', (_this$pluginInjection = this.pluginInjectionApi) !== null && _this$pluginInjection !== void 0 && (_this$pluginInjection2 = _this$pluginInjection.editorDisabled) !== null && _this$pluginInjection2 !== void 0 && (_this$pluginInjection3 = _this$pluginInjection2.sharedState.currentState()) !== null && _this$pluginInjection3 !== void 0 && _this$pluginInjection3.editorDisabled ? 'false' : 'true');
|
|
28
|
+
}
|
|
20
29
|
return {
|
|
21
30
|
dom
|
|
22
31
|
};
|
|
23
32
|
}
|
|
33
|
+
handleEditorDisabledChanged() {
|
|
34
|
+
var _this$pluginInjection4;
|
|
35
|
+
if ((_this$pluginInjection4 = this.pluginInjectionApi) !== null && _this$pluginInjection4 !== void 0 && _this$pluginInjection4.editorDisabled) {
|
|
36
|
+
this.cleanupEditorDisabledListener = this.pluginInjectionApi.editorDisabled.sharedState.onChange(sharedState => {
|
|
37
|
+
if (this.contentDOM) {
|
|
38
|
+
this.contentDOM.setAttribute('contenteditable', sharedState.nextSharedState.editorDisabled ? 'false' : 'true');
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
24
43
|
render(_props, forwardRef) {
|
|
25
44
|
return /*#__PURE__*/React.createElement(Caption, {
|
|
26
45
|
selected: this.insideSelection(),
|
|
@@ -38,10 +57,16 @@ export class CaptionNodeView extends SelectionBasedNodeView {
|
|
|
38
57
|
this.selected = newSelected;
|
|
39
58
|
return selectedStateChange;
|
|
40
59
|
}
|
|
60
|
+
destroy() {
|
|
61
|
+
if (this.cleanupEditorDisabledListener) {
|
|
62
|
+
this.cleanupEditorDisabledListener();
|
|
63
|
+
}
|
|
64
|
+
this.cleanupEditorDisabledListener = undefined;
|
|
65
|
+
}
|
|
41
66
|
}
|
|
42
67
|
export default function captionNodeView(portalProviderAPI, eventDispatcher, pluginInjectionApi) {
|
|
43
68
|
return (node, view, getPos) => {
|
|
44
69
|
const hasIntlContext = true;
|
|
45
|
-
return new CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {}, undefined, undefined, undefined, hasIntlContext).init();
|
|
70
|
+
return new CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {}, undefined, undefined, undefined, hasIntlContext, pluginInjectionApi).init();
|
|
46
71
|
};
|
|
47
72
|
}
|
|
@@ -10,17 +10,23 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
12
12
|
import { Caption } from '@atlaskit/editor-common/ui';
|
|
13
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
13
14
|
export var CaptionNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
14
15
|
_inherits(CaptionNodeView, _SelectionBasedNodeVi);
|
|
15
16
|
var _super = _createSuper(CaptionNodeView);
|
|
16
|
-
function CaptionNodeView() {
|
|
17
|
+
function CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent) {
|
|
17
18
|
var _this;
|
|
19
|
+
var hasContext = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
|
|
20
|
+
var viewShouldUpdate = arguments.length > 8 ? arguments[8] : undefined;
|
|
21
|
+
var hasIntlContext = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
|
|
22
|
+
var pluginInjectionApi = arguments.length > 10 ? arguments[10] : undefined;
|
|
18
23
|
_classCallCheck(this, CaptionNodeView);
|
|
19
|
-
|
|
20
|
-
args[_key] = arguments[_key];
|
|
21
|
-
}
|
|
22
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
24
|
+
_this = _super.call(this, node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, hasContext, viewShouldUpdate, hasIntlContext);
|
|
23
25
|
_defineProperty(_assertThisInitialized(_this), "selected", _this.insideSelection());
|
|
26
|
+
_this.pluginInjectionApi = pluginInjectionApi;
|
|
27
|
+
if (getBooleanFF('platform.editor.live-view.disable-editing-in-view-mode_fi1rx')) {
|
|
28
|
+
_this.handleEditorDisabledChanged();
|
|
29
|
+
}
|
|
24
30
|
return _this;
|
|
25
31
|
}
|
|
26
32
|
_createClass(CaptionNodeView, [{
|
|
@@ -37,10 +43,27 @@ export var CaptionNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
37
43
|
// setting a className prevents PM/Chrome mutation observer from
|
|
38
44
|
// incorrectly deleting nodes
|
|
39
45
|
dom.className = 'caption-wrapper';
|
|
46
|
+
if (getBooleanFF('platform.editor.live-view.disable-editing-in-view-mode_fi1rx')) {
|
|
47
|
+
var _this$pluginInjection;
|
|
48
|
+
dom.setAttribute('contenteditable', (_this$pluginInjection = this.pluginInjectionApi) !== null && _this$pluginInjection !== void 0 && (_this$pluginInjection = _this$pluginInjection.editorDisabled) !== null && _this$pluginInjection !== void 0 && (_this$pluginInjection = _this$pluginInjection.sharedState.currentState()) !== null && _this$pluginInjection !== void 0 && _this$pluginInjection.editorDisabled ? 'false' : 'true');
|
|
49
|
+
}
|
|
40
50
|
return {
|
|
41
51
|
dom: dom
|
|
42
52
|
};
|
|
43
53
|
}
|
|
54
|
+
}, {
|
|
55
|
+
key: "handleEditorDisabledChanged",
|
|
56
|
+
value: function handleEditorDisabledChanged() {
|
|
57
|
+
var _this$pluginInjection2,
|
|
58
|
+
_this2 = this;
|
|
59
|
+
if ((_this$pluginInjection2 = this.pluginInjectionApi) !== null && _this$pluginInjection2 !== void 0 && _this$pluginInjection2.editorDisabled) {
|
|
60
|
+
this.cleanupEditorDisabledListener = this.pluginInjectionApi.editorDisabled.sharedState.onChange(function (sharedState) {
|
|
61
|
+
if (_this2.contentDOM) {
|
|
62
|
+
_this2.contentDOM.setAttribute('contenteditable', sharedState.nextSharedState.editorDisabled ? 'false' : 'true');
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
44
67
|
}, {
|
|
45
68
|
key: "render",
|
|
46
69
|
value: function render(_props, forwardRef) {
|
|
@@ -62,12 +85,20 @@ export var CaptionNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
62
85
|
this.selected = newSelected;
|
|
63
86
|
return selectedStateChange;
|
|
64
87
|
}
|
|
88
|
+
}, {
|
|
89
|
+
key: "destroy",
|
|
90
|
+
value: function destroy() {
|
|
91
|
+
if (this.cleanupEditorDisabledListener) {
|
|
92
|
+
this.cleanupEditorDisabledListener();
|
|
93
|
+
}
|
|
94
|
+
this.cleanupEditorDisabledListener = undefined;
|
|
95
|
+
}
|
|
65
96
|
}]);
|
|
66
97
|
return CaptionNodeView;
|
|
67
98
|
}(SelectionBasedNodeView);
|
|
68
99
|
export default function captionNodeView(portalProviderAPI, eventDispatcher, pluginInjectionApi) {
|
|
69
100
|
return function (node, view, getPos) {
|
|
70
101
|
var hasIntlContext = true;
|
|
71
|
-
return new CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {}, undefined, undefined, undefined, hasIntlContext).init();
|
|
102
|
+
return new CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {}, undefined, undefined, undefined, hasIntlContext, pluginInjectionApi).init();
|
|
72
103
|
};
|
|
73
104
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
3
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
4
|
-
import type { ForwardRef } from '@atlaskit/editor-common/react-node-view';
|
|
4
|
+
import type { ForwardRef, ReactComponentProps, shouldUpdate } from '@atlaskit/editor-common/react-node-view';
|
|
5
5
|
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
6
6
|
import type { ExtractInjectionAPI, getPosHandler } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -9,11 +9,16 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
9
9
|
import type { CaptionPlugin } from '../types';
|
|
10
10
|
export declare class CaptionNodeView extends SelectionBasedNodeView {
|
|
11
11
|
private selected;
|
|
12
|
+
private cleanupEditorDisabledListener?;
|
|
13
|
+
pluginInjectionApi?: ExtractInjectionAPI<CaptionPlugin>;
|
|
14
|
+
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, reactComponentProps: ReactComponentProps, reactComponent?: React.ComponentType<React.PropsWithChildren<unknown>>, hasContext?: boolean, viewShouldUpdate?: shouldUpdate, hasIntlContext?: boolean, pluginInjectionApi?: ExtractInjectionAPI<CaptionPlugin>);
|
|
12
15
|
createDomRef(): HTMLElement;
|
|
13
16
|
getContentDOM(): {
|
|
14
17
|
dom: HTMLDivElement;
|
|
15
18
|
};
|
|
19
|
+
handleEditorDisabledChanged(): void;
|
|
16
20
|
render(_props: never, forwardRef: ForwardRef): JSX.Element;
|
|
17
21
|
viewShouldUpdate(nextNode: PMNode): boolean;
|
|
22
|
+
destroy(): void;
|
|
18
23
|
}
|
|
19
24
|
export default function captionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginInjectionApi: ExtractInjectionAPI<CaptionPlugin> | undefined): (node: PMNode, view: EditorView, getPos: getPosHandler) => CaptionNodeView;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
+
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
3
4
|
export type CaptionPlugin = NextEditorPlugin<'caption', {
|
|
4
|
-
dependencies: [
|
|
5
|
+
dependencies: [
|
|
6
|
+
typeof analyticsPlugin,
|
|
7
|
+
OptionalPlugin<EditorDisabledPlugin>
|
|
8
|
+
];
|
|
5
9
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
3
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
4
|
-
import type { ForwardRef } from '@atlaskit/editor-common/react-node-view';
|
|
4
|
+
import type { ForwardRef, ReactComponentProps, shouldUpdate } from '@atlaskit/editor-common/react-node-view';
|
|
5
5
|
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
6
6
|
import type { ExtractInjectionAPI, getPosHandler } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -9,11 +9,16 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
9
9
|
import type { CaptionPlugin } from '../types';
|
|
10
10
|
export declare class CaptionNodeView extends SelectionBasedNodeView {
|
|
11
11
|
private selected;
|
|
12
|
+
private cleanupEditorDisabledListener?;
|
|
13
|
+
pluginInjectionApi?: ExtractInjectionAPI<CaptionPlugin>;
|
|
14
|
+
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, reactComponentProps: ReactComponentProps, reactComponent?: React.ComponentType<React.PropsWithChildren<unknown>>, hasContext?: boolean, viewShouldUpdate?: shouldUpdate, hasIntlContext?: boolean, pluginInjectionApi?: ExtractInjectionAPI<CaptionPlugin>);
|
|
12
15
|
createDomRef(): HTMLElement;
|
|
13
16
|
getContentDOM(): {
|
|
14
17
|
dom: HTMLDivElement;
|
|
15
18
|
};
|
|
19
|
+
handleEditorDisabledChanged(): void;
|
|
16
20
|
render(_props: never, forwardRef: ForwardRef): JSX.Element;
|
|
17
21
|
viewShouldUpdate(nextNode: PMNode): boolean;
|
|
22
|
+
destroy(): void;
|
|
18
23
|
}
|
|
19
24
|
export default function captionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginInjectionApi: ExtractInjectionAPI<CaptionPlugin> | undefined): (node: PMNode, view: EditorView, getPos: getPosHandler) => CaptionNodeView;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
+
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
3
4
|
export type CaptionPlugin = NextEditorPlugin<'caption', {
|
|
4
5
|
dependencies: [
|
|
5
|
-
typeof analyticsPlugin
|
|
6
|
+
typeof analyticsPlugin,
|
|
7
|
+
OptionalPlugin<EditorDisabledPlugin>
|
|
6
8
|
];
|
|
7
9
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-caption",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Caption plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,24 +32,25 @@
|
|
|
32
32
|
".": "./src/index.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/adf-schema": "^35.
|
|
36
|
-
"@atlaskit/editor-common": "^78.
|
|
35
|
+
"@atlaskit/adf-schema": "^35.12.1",
|
|
36
|
+
"@atlaskit/editor-common": "^78.36.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^1.1.0",
|
|
38
|
+
"@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
|
|
38
39
|
"@atlaskit/editor-prosemirror": "4.0.0",
|
|
40
|
+
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
39
41
|
"@babel/runtime": "^7.0.0"
|
|
40
42
|
},
|
|
41
43
|
"devDependencies": {
|
|
42
44
|
"@atlaskit/editor-plugin-copy-button": "^1.1.0",
|
|
43
45
|
"@atlaskit/editor-plugin-decorations": "^1.1.0",
|
|
44
|
-
"@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
|
|
45
46
|
"@atlaskit/editor-plugin-feature-flags": "^1.1.0",
|
|
46
|
-
"@atlaskit/editor-plugin-floating-toolbar": "^1.
|
|
47
|
+
"@atlaskit/editor-plugin-floating-toolbar": "^1.4.0",
|
|
47
48
|
"@atlaskit/editor-plugin-focus": "^1.2.0",
|
|
48
49
|
"@atlaskit/editor-plugin-grid": "^1.1.0",
|
|
49
50
|
"@atlaskit/editor-plugin-guideline": "^1.1.0",
|
|
50
51
|
"@atlaskit/editor-plugin-selection": "^1.2.0",
|
|
51
52
|
"@atlaskit/editor-plugin-width": "^1.1.0",
|
|
52
|
-
"@atlaskit/renderer": "^109.
|
|
53
|
+
"@atlaskit/renderer": "^109.22.0",
|
|
53
54
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0"
|
|
54
55
|
},
|
|
55
56
|
"peerDependencies": {
|
|
@@ -85,5 +86,10 @@
|
|
|
85
86
|
]
|
|
86
87
|
}
|
|
87
88
|
},
|
|
88
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
89
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0",
|
|
90
|
+
"platform-feature-flags": {
|
|
91
|
+
"platform.editor.live-view.disable-editing-in-view-mode_fi1rx": {
|
|
92
|
+
"type": "boolean"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
89
95
|
}
|