@atlaskit/editor-common 93.1.6 → 93.2.1
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 +24 -0
- package/afm-jira/tsconfig.json +3 -0
- package/afm-post-office/tsconfig.json +3 -0
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/extensibility/ExtensionComponent.js +263 -10
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/imageLoader.js +91 -2
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/extensibility/ExtensionComponent.js +231 -3
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/imageLoader.js +73 -1
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/extensibility/ExtensionComponent.js +266 -9
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/imageLoader.js +90 -1
- package/dist/types/analytics/types/enums.d.ts +1 -0
- package/dist/types/analytics/types/general-events.d.ts +7 -1
- package/dist/types/extensibility/ExtensionComponent.d.ts +7 -1
- package/dist/types/utils/imageLoader.d.ts +3 -1
- package/dist/types-ts4.5/analytics/types/enums.d.ts +1 -0
- package/dist/types-ts4.5/analytics/types/general-events.d.ts +7 -1
- package/dist/types-ts4.5/extensibility/ExtensionComponent.d.ts +7 -1
- package/dist/types-ts4.5/utils/imageLoader.d.ts +3 -1
- package/package.json +9 -3
|
@@ -21,7 +21,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
21
21
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "93.1
|
|
24
|
+
var packageVersion = "93.2.1";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -9,7 +9,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
9
9
|
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
import React, { Component } from 'react';
|
|
12
|
-
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
+
export var withImageLoaderOld = function withImageLoaderOld(Wrapped) {
|
|
13
14
|
return /*#__PURE__*/function (_Component) {
|
|
14
15
|
_inherits(WithImageLoader, _Component);
|
|
15
16
|
var _super = _createSuper(WithImageLoader);
|
|
@@ -90,4 +91,92 @@ export var withImageLoader = function withImageLoader(Wrapped) {
|
|
|
90
91
|
}]);
|
|
91
92
|
return WithImageLoader;
|
|
92
93
|
}(Component);
|
|
94
|
+
};
|
|
95
|
+
var withImageLoaderNew = function withImageLoaderNew(Wrapped) {
|
|
96
|
+
return /*#__PURE__*/function (_Component2) {
|
|
97
|
+
_inherits(WithImageLoader, _Component2);
|
|
98
|
+
var _super2 = _createSuper(WithImageLoader);
|
|
99
|
+
function WithImageLoader() {
|
|
100
|
+
var _this2;
|
|
101
|
+
_classCallCheck(this, WithImageLoader);
|
|
102
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
103
|
+
args[_key2] = arguments[_key2];
|
|
104
|
+
}
|
|
105
|
+
_this2 = _super2.call.apply(_super2, [this].concat(args));
|
|
106
|
+
_defineProperty(_assertThisInitialized(_this2), "state", {
|
|
107
|
+
imageStatus: 'loading'
|
|
108
|
+
});
|
|
109
|
+
_defineProperty(_assertThisInitialized(_this2), "onLoad", function () {
|
|
110
|
+
_this2.setState({
|
|
111
|
+
imageStatus: 'complete'
|
|
112
|
+
});
|
|
113
|
+
var onExternalImageLoaded = _this2.props.onExternalImageLoaded;
|
|
114
|
+
if (onExternalImageLoaded && _this2.img) {
|
|
115
|
+
onExternalImageLoaded({
|
|
116
|
+
width: _this2.img.naturalWidth,
|
|
117
|
+
height: _this2.img.naturalHeight
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
_defineProperty(_assertThisInitialized(_this2), "onError", function () {
|
|
122
|
+
_this2.setState({
|
|
123
|
+
imageStatus: 'error'
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
return _this2;
|
|
127
|
+
}
|
|
128
|
+
_createClass(WithImageLoader, [{
|
|
129
|
+
key: "componentDidMount",
|
|
130
|
+
value: function componentDidMount() {
|
|
131
|
+
this.fetchImage(this.props);
|
|
132
|
+
}
|
|
133
|
+
}, {
|
|
134
|
+
key: "componentDidUpdate",
|
|
135
|
+
value: function componentDidUpdate(newProps) {
|
|
136
|
+
if (newProps.url !== this.props.url) {
|
|
137
|
+
this.setState({
|
|
138
|
+
imageStatus: 'loading'
|
|
139
|
+
});
|
|
140
|
+
this.fetchImage(newProps);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}, {
|
|
144
|
+
key: "componentWillUnmount",
|
|
145
|
+
value: function componentWillUnmount() {
|
|
146
|
+
if (this.img) {
|
|
147
|
+
this.img.removeEventListener('load', this.onLoad);
|
|
148
|
+
this.img.removeEventListener('error', this.onError);
|
|
149
|
+
this.img = null;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}, {
|
|
153
|
+
key: "fetchImage",
|
|
154
|
+
value: function fetchImage(_ref2) {
|
|
155
|
+
var url = _ref2.url;
|
|
156
|
+
if (url) {
|
|
157
|
+
if (!this.img) {
|
|
158
|
+
this.img = new Image();
|
|
159
|
+
this.img.addEventListener('load', this.onLoad);
|
|
160
|
+
this.img.addEventListener('error', this.onError);
|
|
161
|
+
}
|
|
162
|
+
this.img.src = url;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}, {
|
|
166
|
+
key: "render",
|
|
167
|
+
value: function render() {
|
|
168
|
+
var imageStatus = this.state.imageStatus;
|
|
169
|
+
return /*#__PURE__*/React.createElement(Wrapped, _extends({}, this.props, {
|
|
170
|
+
imageStatus: imageStatus
|
|
171
|
+
}));
|
|
172
|
+
}
|
|
173
|
+
}]);
|
|
174
|
+
return WithImageLoader;
|
|
175
|
+
}(Component);
|
|
176
|
+
};
|
|
177
|
+
export var withImageLoader = function withImageLoader(Wrapped) {
|
|
178
|
+
if (fg('platform_editor_react18_phase2')) {
|
|
179
|
+
return withImageLoaderNew(Wrapped);
|
|
180
|
+
}
|
|
181
|
+
return withImageLoaderOld(Wrapped);
|
|
93
182
|
};
|
|
@@ -277,6 +277,7 @@ export declare enum ACTION_SUBJECT_ID {
|
|
|
277
277
|
CODE_BLOCK = "codeBlock",
|
|
278
278
|
CODEBLOCK_COPY = "codeBlockCopy",
|
|
279
279
|
CODEBLOCK_WRAP = "codeBlockWrap",
|
|
280
|
+
COPY_LINK_TO_ANCHOR = "copyLinkToAnchor",
|
|
280
281
|
CREATE_INLINE_COMMENT_FROM_HIGHLIGHT_ACTIONS_MENU = "createInlineCommentFromHighlightActionsMenu",
|
|
281
282
|
DATE = "date",
|
|
282
283
|
DATE_DAY = "day",
|
|
@@ -195,5 +195,11 @@ export type RequestToEditAEP = UIAEP<ACTION.REQUEST_TO_EDIT | ACTION.DISMISSED,
|
|
|
195
195
|
platform: PLATFORMS;
|
|
196
196
|
mode: MODE;
|
|
197
197
|
}, undefined>;
|
|
198
|
-
|
|
198
|
+
type CopyLinkToAnchorButtonAEP = ButtonAEP<ACTION_SUBJECT_ID.COPY_LINK_TO_ANCHOR, {
|
|
199
|
+
inputMethod: INPUT_METHOD;
|
|
200
|
+
extensionKey?: string;
|
|
201
|
+
extensionType?: string;
|
|
202
|
+
isLivePage?: boolean;
|
|
203
|
+
}>;
|
|
204
|
+
export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | DispatchedTransactionAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | EditorTTIAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamlingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | PickerMediaInsertAEP | PickerMediaInsertClosedAEP | PickerMediaInsertCancelledAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | UfoSessionCompletePayloadAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | CodeBlockWordWrapToggleAEP | RequestToEditAEP | CopyLinkToAnchorButtonAEP;
|
|
199
205
|
export {};
|
|
@@ -29,7 +29,11 @@ export interface State {
|
|
|
29
29
|
activeChildIndex?: number;
|
|
30
30
|
isNodeHovered?: boolean;
|
|
31
31
|
}
|
|
32
|
-
export
|
|
32
|
+
export type PropsNew = Omit<Props, 'extensionProvider'> & {
|
|
33
|
+
extensionProvider?: ExtensionProvider;
|
|
34
|
+
};
|
|
35
|
+
export type StateNew = Omit<State, 'extensionProvider'>;
|
|
36
|
+
export declare class ExtensionComponentOld extends Component<Props, State> {
|
|
33
37
|
private privatePropsParsed;
|
|
34
38
|
state: State;
|
|
35
39
|
mounted: boolean;
|
|
@@ -54,3 +58,5 @@ export declare class ExtensionComponent extends Component<Props, State> {
|
|
|
54
58
|
private tryExtensionHandler;
|
|
55
59
|
private handleExtension;
|
|
56
60
|
}
|
|
61
|
+
export declare const ExtensionComponentNew: (props: Props) => JSX.Element;
|
|
62
|
+
export declare const ExtensionComponent: (props: Props) => JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ComponentType } from 'react';
|
|
2
3
|
export interface ImageLoaderProps {
|
|
3
4
|
url?: string;
|
|
4
5
|
onExternalImageLoaded?: (dimensions: {
|
|
@@ -11,4 +12,5 @@ export interface ImageLoaderState {
|
|
|
11
12
|
imageStatus: ImageStatus;
|
|
12
13
|
}
|
|
13
14
|
export type ImageStatus = 'complete' | 'loading' | 'error';
|
|
15
|
+
export declare const withImageLoaderOld: <P extends {}>(Wrapped: ComponentType<React.PropsWithChildren<P & ImageLoaderProps>>) => React.ComponentClass<P & ImageLoaderProps>;
|
|
14
16
|
export declare const withImageLoader: <P extends {}>(Wrapped: ComponentType<React.PropsWithChildren<P & ImageLoaderProps>>) => React.ComponentClass<P & ImageLoaderProps>;
|
|
@@ -277,6 +277,7 @@ export declare enum ACTION_SUBJECT_ID {
|
|
|
277
277
|
CODE_BLOCK = "codeBlock",
|
|
278
278
|
CODEBLOCK_COPY = "codeBlockCopy",
|
|
279
279
|
CODEBLOCK_WRAP = "codeBlockWrap",
|
|
280
|
+
COPY_LINK_TO_ANCHOR = "copyLinkToAnchor",
|
|
280
281
|
CREATE_INLINE_COMMENT_FROM_HIGHLIGHT_ACTIONS_MENU = "createInlineCommentFromHighlightActionsMenu",
|
|
281
282
|
DATE = "date",
|
|
282
283
|
DATE_DAY = "day",
|
|
@@ -195,5 +195,11 @@ export type RequestToEditAEP = UIAEP<ACTION.REQUEST_TO_EDIT | ACTION.DISMISSED,
|
|
|
195
195
|
platform: PLATFORMS;
|
|
196
196
|
mode: MODE;
|
|
197
197
|
}, undefined>;
|
|
198
|
-
|
|
198
|
+
type CopyLinkToAnchorButtonAEP = ButtonAEP<ACTION_SUBJECT_ID.COPY_LINK_TO_ANCHOR, {
|
|
199
|
+
inputMethod: INPUT_METHOD;
|
|
200
|
+
extensionKey?: string;
|
|
201
|
+
extensionType?: string;
|
|
202
|
+
isLivePage?: boolean;
|
|
203
|
+
}>;
|
|
204
|
+
export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | DispatchedTransactionAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | EditorTTIAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamlingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | PickerMediaInsertAEP | PickerMediaInsertClosedAEP | PickerMediaInsertCancelledAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP | UfoSessionCompletePayloadAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | CodeBlockWordWrapToggleAEP | RequestToEditAEP | CopyLinkToAnchorButtonAEP;
|
|
199
205
|
export {};
|
|
@@ -29,7 +29,11 @@ export interface State {
|
|
|
29
29
|
activeChildIndex?: number;
|
|
30
30
|
isNodeHovered?: boolean;
|
|
31
31
|
}
|
|
32
|
-
export
|
|
32
|
+
export type PropsNew = Omit<Props, 'extensionProvider'> & {
|
|
33
|
+
extensionProvider?: ExtensionProvider;
|
|
34
|
+
};
|
|
35
|
+
export type StateNew = Omit<State, 'extensionProvider'>;
|
|
36
|
+
export declare class ExtensionComponentOld extends Component<Props, State> {
|
|
33
37
|
private privatePropsParsed;
|
|
34
38
|
state: State;
|
|
35
39
|
mounted: boolean;
|
|
@@ -54,3 +58,5 @@ export declare class ExtensionComponent extends Component<Props, State> {
|
|
|
54
58
|
private tryExtensionHandler;
|
|
55
59
|
private handleExtension;
|
|
56
60
|
}
|
|
61
|
+
export declare const ExtensionComponentNew: (props: Props) => JSX.Element;
|
|
62
|
+
export declare const ExtensionComponent: (props: Props) => JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ComponentType } from 'react';
|
|
2
3
|
export interface ImageLoaderProps {
|
|
3
4
|
url?: string;
|
|
4
5
|
onExternalImageLoaded?: (dimensions: {
|
|
@@ -11,4 +12,5 @@ export interface ImageLoaderState {
|
|
|
11
12
|
imageStatus: ImageStatus;
|
|
12
13
|
}
|
|
13
14
|
export type ImageStatus = 'complete' | 'loading' | 'error';
|
|
15
|
+
export declare const withImageLoaderOld: <P extends {}>(Wrapped: ComponentType<React.PropsWithChildren<P & ImageLoaderProps>>) => React.ComponentClass<P & ImageLoaderProps>;
|
|
14
16
|
export declare const withImageLoader: <P extends {}>(Wrapped: ComponentType<React.PropsWithChildren<P & ImageLoaderProps>>) => React.ComponentClass<P & ImageLoaderProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "93.1
|
|
3
|
+
"version": "93.2.1",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"@atlaskit/media-file-preview": "^0.9.0",
|
|
138
138
|
"@atlaskit/media-picker": "^66.7.0",
|
|
139
139
|
"@atlaskit/media-ui": "^25.15.0",
|
|
140
|
-
"@atlaskit/media-viewer": "49.0
|
|
140
|
+
"@atlaskit/media-viewer": "49.1.0",
|
|
141
141
|
"@atlaskit/mention": "^23.3.0",
|
|
142
142
|
"@atlaskit/menu": "^2.12.0",
|
|
143
143
|
"@atlaskit/onboarding": "^11.2.0",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"@atlaskit/primitives": "^12.2.0",
|
|
146
146
|
"@atlaskit/profilecard": "^20.4.0",
|
|
147
147
|
"@atlaskit/section-message": "^6.6.0",
|
|
148
|
-
"@atlaskit/smart-card": "^29.
|
|
148
|
+
"@atlaskit/smart-card": "^29.3.0",
|
|
149
149
|
"@atlaskit/smart-user-picker": "^6.10.0",
|
|
150
150
|
"@atlaskit/spinner": "^16.3.0",
|
|
151
151
|
"@atlaskit/task-decision": "^17.11.0",
|
|
@@ -265,12 +265,18 @@
|
|
|
265
265
|
"platform_editor_react18_mention_with_provider": {
|
|
266
266
|
"type": "boolean"
|
|
267
267
|
},
|
|
268
|
+
"platform_editor_react18_phase2": {
|
|
269
|
+
"type": "boolean"
|
|
270
|
+
},
|
|
268
271
|
"cc_page_experiences_live_search_wysiwyg": {
|
|
269
272
|
"type": "boolean"
|
|
270
273
|
},
|
|
271
274
|
"use-effect-in-use-previous-props": {
|
|
272
275
|
"type": "boolean"
|
|
273
276
|
},
|
|
277
|
+
"platform_editor_react18_extension_component": {
|
|
278
|
+
"type": "boolean"
|
|
279
|
+
},
|
|
274
280
|
"platform-datasources-enable-two-way-sync": {
|
|
275
281
|
"type": "boolean"
|
|
276
282
|
},
|