@atlaskit/editor-plugin-caption 1.5.2 → 1.6.0
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 +18 -0
- package/dist/cjs/nodeviews/index.js +5 -10
- package/dist/es2019/nodeviews/index.js +6 -7
- package/dist/esm/nodeviews/index.js +6 -11
- package/dist/types/nodeviews/index.d.ts +2 -3
- package/dist/types/pm-plugins/main.d.ts +1 -2
- package/dist/types-ts4.5/nodeviews/index.d.ts +2 -3
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-caption
|
|
2
2
|
|
|
3
|
+
## 1.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#119966](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/119966)
|
|
8
|
+
[`596ad24e38929`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/596ad24e38929) -
|
|
9
|
+
Clean up typescript references to LegacyPortalProviderAPI
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 1.5.3
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 1.5.2
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -22,17 +22,13 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
22
22
|
var CaptionNodeView = exports.CaptionNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
23
23
|
(0, _inherits2.default)(CaptionNodeView, _SelectionBasedNodeVi);
|
|
24
24
|
var _super = _createSuper(CaptionNodeView);
|
|
25
|
-
function CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent) {
|
|
25
|
+
function CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, viewShouldUpdate, pluginInjectionApi) {
|
|
26
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;
|
|
31
27
|
(0, _classCallCheck2.default)(this, CaptionNodeView);
|
|
32
|
-
_this = _super.call(this, node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent,
|
|
28
|
+
_this = _super.call(this, node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, viewShouldUpdate);
|
|
33
29
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "selected", _this.insideSelection());
|
|
34
30
|
_this.pluginInjectionApi = pluginInjectionApi;
|
|
35
|
-
if ((0, _platformFeatureFlags.
|
|
31
|
+
if ((0, _platformFeatureFlags.fg)('platform.editor.live-view.disable-editing-in-view-mode_fi1rx')) {
|
|
36
32
|
_this.handleEditorDisabledChanged();
|
|
37
33
|
}
|
|
38
34
|
return _this;
|
|
@@ -51,7 +47,7 @@ var CaptionNodeView = exports.CaptionNodeView = /*#__PURE__*/function (_Selectio
|
|
|
51
47
|
// setting a className prevents PM/Chrome mutation observer from
|
|
52
48
|
// incorrectly deleting nodes
|
|
53
49
|
dom.className = 'caption-wrapper';
|
|
54
|
-
if ((0, _platformFeatureFlags.
|
|
50
|
+
if ((0, _platformFeatureFlags.fg)('platform.editor.live-view.disable-editing-in-view-mode_fi1rx')) {
|
|
55
51
|
var _this$pluginInjection;
|
|
56
52
|
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
53
|
}
|
|
@@ -106,7 +102,6 @@ var CaptionNodeView = exports.CaptionNodeView = /*#__PURE__*/function (_Selectio
|
|
|
106
102
|
}(_selectionBasedNodeView.SelectionBasedNodeView);
|
|
107
103
|
function captionNodeView(portalProviderAPI, eventDispatcher, pluginInjectionApi) {
|
|
108
104
|
return function (node, view, getPos) {
|
|
109
|
-
|
|
110
|
-
return new CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {}, undefined, undefined, undefined, hasIntlContext, pluginInjectionApi).init();
|
|
105
|
+
return new CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {}, undefined, undefined, pluginInjectionApi).init();
|
|
111
106
|
};
|
|
112
107
|
}
|
|
@@ -2,13 +2,13 @@ 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 {
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
export class CaptionNodeView extends SelectionBasedNodeView {
|
|
7
|
-
constructor(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent,
|
|
8
|
-
super(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent,
|
|
7
|
+
constructor(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, viewShouldUpdate, pluginInjectionApi) {
|
|
8
|
+
super(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, viewShouldUpdate);
|
|
9
9
|
_defineProperty(this, "selected", this.insideSelection());
|
|
10
10
|
this.pluginInjectionApi = pluginInjectionApi;
|
|
11
|
-
if (
|
|
11
|
+
if (fg('platform.editor.live-view.disable-editing-in-view-mode_fi1rx')) {
|
|
12
12
|
this.handleEditorDisabledChanged();
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -22,7 +22,7 @@ export class CaptionNodeView extends SelectionBasedNodeView {
|
|
|
22
22
|
// setting a className prevents PM/Chrome mutation observer from
|
|
23
23
|
// incorrectly deleting nodes
|
|
24
24
|
dom.className = 'caption-wrapper';
|
|
25
|
-
if (
|
|
25
|
+
if (fg('platform.editor.live-view.disable-editing-in-view-mode_fi1rx')) {
|
|
26
26
|
var _this$pluginInjection, _this$pluginInjection2, _this$pluginInjection3;
|
|
27
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
28
|
}
|
|
@@ -66,7 +66,6 @@ export class CaptionNodeView extends SelectionBasedNodeView {
|
|
|
66
66
|
}
|
|
67
67
|
export default function captionNodeView(portalProviderAPI, eventDispatcher, pluginInjectionApi) {
|
|
68
68
|
return (node, view, getPos) => {
|
|
69
|
-
|
|
70
|
-
return new CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {}, undefined, undefined, undefined, hasIntlContext, pluginInjectionApi).init();
|
|
69
|
+
return new CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {}, undefined, undefined, pluginInjectionApi).init();
|
|
71
70
|
};
|
|
72
71
|
}
|
|
@@ -10,21 +10,17 @@ 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 {
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
export var CaptionNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
15
15
|
_inherits(CaptionNodeView, _SelectionBasedNodeVi);
|
|
16
16
|
var _super = _createSuper(CaptionNodeView);
|
|
17
|
-
function CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent) {
|
|
17
|
+
function CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, viewShouldUpdate, pluginInjectionApi) {
|
|
18
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;
|
|
23
19
|
_classCallCheck(this, CaptionNodeView);
|
|
24
|
-
_this = _super.call(this, node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent,
|
|
20
|
+
_this = _super.call(this, node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, viewShouldUpdate);
|
|
25
21
|
_defineProperty(_assertThisInitialized(_this), "selected", _this.insideSelection());
|
|
26
22
|
_this.pluginInjectionApi = pluginInjectionApi;
|
|
27
|
-
if (
|
|
23
|
+
if (fg('platform.editor.live-view.disable-editing-in-view-mode_fi1rx')) {
|
|
28
24
|
_this.handleEditorDisabledChanged();
|
|
29
25
|
}
|
|
30
26
|
return _this;
|
|
@@ -43,7 +39,7 @@ export var CaptionNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
43
39
|
// setting a className prevents PM/Chrome mutation observer from
|
|
44
40
|
// incorrectly deleting nodes
|
|
45
41
|
dom.className = 'caption-wrapper';
|
|
46
|
-
if (
|
|
42
|
+
if (fg('platform.editor.live-view.disable-editing-in-view-mode_fi1rx')) {
|
|
47
43
|
var _this$pluginInjection;
|
|
48
44
|
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
45
|
}
|
|
@@ -98,7 +94,6 @@ export var CaptionNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
98
94
|
}(SelectionBasedNodeView);
|
|
99
95
|
export default function captionNodeView(portalProviderAPI, eventDispatcher, pluginInjectionApi) {
|
|
100
96
|
return function (node, view, getPos) {
|
|
101
|
-
|
|
102
|
-
return new CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {}, undefined, undefined, undefined, hasIntlContext, pluginInjectionApi).init();
|
|
97
|
+
return new CaptionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {}, undefined, undefined, pluginInjectionApi).init();
|
|
103
98
|
};
|
|
104
99
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
-
import type { LegacyPortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
4
3
|
import type { ForwardRef, ReactComponentProps, shouldUpdate } from '@atlaskit/editor-common/react-node-view';
|
|
5
4
|
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
6
5
|
import { type PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
|
|
@@ -12,7 +11,7 @@ export declare class CaptionNodeView extends SelectionBasedNodeView {
|
|
|
12
11
|
private selected;
|
|
13
12
|
private cleanupEditorDisabledListener?;
|
|
14
13
|
pluginInjectionApi?: ExtractInjectionAPI<CaptionPlugin>;
|
|
15
|
-
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI:
|
|
14
|
+
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, reactComponentProps: ReactComponentProps, reactComponent?: React.ComponentType<React.PropsWithChildren<unknown>>, viewShouldUpdate?: shouldUpdate, pluginInjectionApi?: ExtractInjectionAPI<CaptionPlugin>);
|
|
16
15
|
createDomRef(): HTMLElement;
|
|
17
16
|
getContentDOM(): {
|
|
18
17
|
dom: HTMLDivElement;
|
|
@@ -22,4 +21,4 @@ export declare class CaptionNodeView extends SelectionBasedNodeView {
|
|
|
22
21
|
viewShouldUpdate(nextNode: PMNode): boolean;
|
|
23
22
|
destroy(): void;
|
|
24
23
|
}
|
|
25
|
-
export default function captionNodeView(portalProviderAPI:
|
|
24
|
+
export default function captionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginInjectionApi: ExtractInjectionAPI<CaptionPlugin> | undefined): (node: PMNode, view: EditorView, getPos: getPosHandler) => CaptionNodeView;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
-
import type { LegacyPortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
3
2
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
4
|
import { type PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
|
|
6
5
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
6
|
import type { CaptionPlugin } from '../types';
|
|
8
|
-
declare const _default: (portalProviderAPI:
|
|
7
|
+
declare const _default: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, dispatch: Dispatch, pluginInjectionApi: ExtractInjectionAPI<CaptionPlugin> | undefined) => SafePlugin<any>;
|
|
9
8
|
export default _default;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
-
import type { LegacyPortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
4
3
|
import type { ForwardRef, ReactComponentProps, shouldUpdate } from '@atlaskit/editor-common/react-node-view';
|
|
5
4
|
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
6
5
|
import { type PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
|
|
@@ -12,7 +11,7 @@ export declare class CaptionNodeView extends SelectionBasedNodeView {
|
|
|
12
11
|
private selected;
|
|
13
12
|
private cleanupEditorDisabledListener?;
|
|
14
13
|
pluginInjectionApi?: ExtractInjectionAPI<CaptionPlugin>;
|
|
15
|
-
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI:
|
|
14
|
+
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, reactComponentProps: ReactComponentProps, reactComponent?: React.ComponentType<React.PropsWithChildren<unknown>>, viewShouldUpdate?: shouldUpdate, pluginInjectionApi?: ExtractInjectionAPI<CaptionPlugin>);
|
|
16
15
|
createDomRef(): HTMLElement;
|
|
17
16
|
getContentDOM(): {
|
|
18
17
|
dom: HTMLDivElement;
|
|
@@ -22,4 +21,4 @@ export declare class CaptionNodeView extends SelectionBasedNodeView {
|
|
|
22
21
|
viewShouldUpdate(nextNode: PMNode): boolean;
|
|
23
22
|
destroy(): void;
|
|
24
23
|
}
|
|
25
|
-
export default function captionNodeView(portalProviderAPI:
|
|
24
|
+
export default function captionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginInjectionApi: ExtractInjectionAPI<CaptionPlugin> | undefined): (node: PMNode, view: EditorView, getPos: getPosHandler) => CaptionNodeView;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
-
import type { LegacyPortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
3
2
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
4
|
import { type PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
|
|
6
5
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
6
|
import type { CaptionPlugin } from '../types';
|
|
8
|
-
declare const _default: (portalProviderAPI:
|
|
7
|
+
declare const _default: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, dispatch: Dispatch, pluginInjectionApi: ExtractInjectionAPI<CaptionPlugin> | undefined) => SafePlugin<any>;
|
|
9
8
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-caption",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Caption plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/adf-schema": "^39.0.3",
|
|
36
|
-
"@atlaskit/editor-common": "^
|
|
36
|
+
"@atlaskit/editor-common": "^85.0.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^1.4.0",
|
|
38
38
|
"@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
|
|
39
39
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@atlaskit/editor-plugin-guideline": "^1.1.0",
|
|
51
51
|
"@atlaskit/editor-plugin-selection": "^1.2.0",
|
|
52
52
|
"@atlaskit/editor-plugin-width": "^1.1.0",
|
|
53
|
-
"@atlaskit/renderer": "^109.
|
|
53
|
+
"@atlaskit/renderer": "^109.42.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"react": "^16.8.0"
|