@atlaskit/editor-core 179.0.3 → 179.0.4
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 +6 -0
- package/dist/cjs/editor.js +36 -1
- package/dist/cjs/test-utils.js +13 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/editor.js +36 -0
- package/dist/es2019/test-utils.js +11 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/editor.js +36 -1
- package/dist/esm/test-utils.js +11 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/editor.d.ts +42 -0
- package/dist/types/test-utils.d.ts +7 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 179.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5139cd8cbdf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5139cd8cbdf) - [ED-16854] Add @deprecate annotations to public class methods in editor.
|
|
8
|
+
|
|
3
9
|
## 179.0.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/editor.js
CHANGED
|
@@ -180,6 +180,13 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @private
|
|
186
|
+
* @deprecated - Do not override this at all, this is an anti-pattern.
|
|
187
|
+
* Please reach out to the Editor team if you were previously using this
|
|
188
|
+
* and need to find a workaround.
|
|
189
|
+
*/
|
|
183
190
|
}, {
|
|
184
191
|
key: "trackEditorActions",
|
|
185
192
|
value: function trackEditorActions(editorActions, props) {
|
|
@@ -266,9 +273,23 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
266
273
|
}
|
|
267
274
|
return editorActions;
|
|
268
275
|
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* @private
|
|
279
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
280
|
+
* Please reach out to the Editor team if you were previously using this
|
|
281
|
+
* and need to find a workaround.
|
|
282
|
+
*/
|
|
269
283
|
}, {
|
|
270
284
|
key: "onEditorCreated",
|
|
271
|
-
value:
|
|
285
|
+
value:
|
|
286
|
+
/**
|
|
287
|
+
* @private
|
|
288
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
289
|
+
* Please reach out to the Editor team if you were previously using this
|
|
290
|
+
* and need to find a workaround.
|
|
291
|
+
*/
|
|
292
|
+
function onEditorCreated(instance) {
|
|
272
293
|
var _this$props$featureFl2;
|
|
273
294
|
this.registerEditorForActions(instance.view, instance.eventDispatcher, instance.transformer);
|
|
274
295
|
if ((_this$props$featureFl2 = this.props.featureFlags) !== null && _this$props$featureFl2 !== void 0 && _this$props$featureFl2.ufo) {
|
|
@@ -372,6 +393,13 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
372
393
|
console.warn("\"allowMoreTextColors\" field of \"allowTextColor\" property is deprecated. It will be removedin editor-core@".concat(nextVersion, ". The color palette now shows more colors by default."));
|
|
373
394
|
}
|
|
374
395
|
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* @private
|
|
399
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
400
|
+
* Please reach out to the Editor team if you were previously using this
|
|
401
|
+
* and need to find a workaround.
|
|
402
|
+
*/
|
|
375
403
|
}, {
|
|
376
404
|
key: "onEditorDestroyed",
|
|
377
405
|
value: function onEditorDestroyed(_instance) {
|
|
@@ -443,6 +471,13 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
443
471
|
value: function getBaseFontSize() {
|
|
444
472
|
return !['comment', 'chromeless', 'mobile'].includes(this.props.appearance) ? _editorSharedStyles.akEditorFullPageDefaultFontSize : undefined;
|
|
445
473
|
}
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* @private
|
|
477
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
478
|
+
* Please reach out to the Editor team if you were previously using this
|
|
479
|
+
* and need to find a workaround.
|
|
480
|
+
*/
|
|
446
481
|
}, {
|
|
447
482
|
key: "render",
|
|
448
483
|
value: function render() {
|
package/dist/cjs/test-utils.js
CHANGED
|
@@ -42,6 +42,7 @@ Object.defineProperty(exports, "createTypeAheadTools", {
|
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
exports.getFireAnalytics = getFireAnalytics;
|
|
45
|
+
exports.isElementBySelectorInDocument = void 0;
|
|
45
46
|
exports.setTextSelection = setTextSelection;
|
|
46
47
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
47
48
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
@@ -134,4 +135,15 @@ function setTextSelection(view, anchor, head) {
|
|
|
134
135
|
var state = view.state;
|
|
135
136
|
var tr = state.tr.setSelection(_prosemirrorState.TextSelection.create(state.doc, anchor, head));
|
|
136
137
|
view.dispatch(tr);
|
|
137
|
-
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Given a selector, checks if an element matching the selector exists in the
|
|
142
|
+
* document.
|
|
143
|
+
* @param selector
|
|
144
|
+
* @returns true if element matching selector exists in document, false otherwise
|
|
145
|
+
*/
|
|
146
|
+
var isElementBySelectorInDocument = function isElementBySelectorInDocument(selector) {
|
|
147
|
+
return Boolean(document.querySelector(selector));
|
|
148
|
+
};
|
|
149
|
+
exports.isElementBySelectorInDocument = isElementBySelectorInDocument;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "179.0.
|
|
9
|
+
var version = "179.0.4";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/editor.js
CHANGED
|
@@ -148,6 +148,13 @@ export default class Editor extends React.Component {
|
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* @private
|
|
154
|
+
* @deprecated - Do not override this at all, this is an anti-pattern.
|
|
155
|
+
* Please reach out to the Editor team if you were previously using this
|
|
156
|
+
* and need to find a workaround.
|
|
157
|
+
*/
|
|
151
158
|
trackEditorActions(editorActions, props) {
|
|
152
159
|
var _props$performanceTra9, _props$performanceTra10;
|
|
153
160
|
if (props !== null && props !== void 0 && (_props$performanceTra9 = props.performanceTracking) !== null && _props$performanceTra9 !== void 0 && (_props$performanceTra10 = _props$performanceTra9.contentRetrievalTracking) !== null && _props$performanceTra10 !== void 0 && _props$performanceTra10.enabled) {
|
|
@@ -216,6 +223,20 @@ export default class Editor extends React.Component {
|
|
|
216
223
|
}
|
|
217
224
|
return editorActions;
|
|
218
225
|
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* @private
|
|
229
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
230
|
+
* Please reach out to the Editor team if you were previously using this
|
|
231
|
+
* and need to find a workaround.
|
|
232
|
+
*/
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* @private
|
|
236
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
237
|
+
* Please reach out to the Editor team if you were previously using this
|
|
238
|
+
* and need to find a workaround.
|
|
239
|
+
*/
|
|
219
240
|
onEditorCreated(instance) {
|
|
220
241
|
var _this$props$featureFl2;
|
|
221
242
|
this.registerEditorForActions(instance.view, instance.eventDispatcher, instance.transformer);
|
|
@@ -297,6 +318,13 @@ export default class Editor extends React.Component {
|
|
|
297
318
|
console.warn(`"allowMoreTextColors" field of "allowTextColor" property is deprecated. It will be removedin editor-core@${nextVersion}. The color palette now shows more colors by default.`);
|
|
298
319
|
}
|
|
299
320
|
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* @private
|
|
324
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
325
|
+
* Please reach out to the Editor team if you were previously using this
|
|
326
|
+
* and need to find a workaround.
|
|
327
|
+
*/
|
|
300
328
|
onEditorDestroyed(_instance) {
|
|
301
329
|
this.unregisterEditorFromActions();
|
|
302
330
|
if (this.props.onDestroy) {
|
|
@@ -361,6 +389,14 @@ export default class Editor extends React.Component {
|
|
|
361
389
|
getBaseFontSize() {
|
|
362
390
|
return !['comment', 'chromeless', 'mobile'].includes(this.props.appearance) ? akEditorFullPageDefaultFontSize : undefined;
|
|
363
391
|
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* @private
|
|
395
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
396
|
+
* Please reach out to the Editor team if you were previously using this
|
|
397
|
+
* and need to find a workaround.
|
|
398
|
+
*/
|
|
399
|
+
|
|
364
400
|
render() {
|
|
365
401
|
var _this$props$performan3, _this$props$performan4;
|
|
366
402
|
const Component = getUiComponent(this.props.appearance);
|
|
@@ -79,4 +79,14 @@ export function setTextSelection(view, anchor, head) {
|
|
|
79
79
|
} = view;
|
|
80
80
|
const tr = state.tr.setSelection(TextSelection.create(state.doc, anchor, head));
|
|
81
81
|
view.dispatch(tr);
|
|
82
|
-
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Given a selector, checks if an element matching the selector exists in the
|
|
86
|
+
* document.
|
|
87
|
+
* @param selector
|
|
88
|
+
* @returns true if element matching selector exists in document, false otherwise
|
|
89
|
+
*/
|
|
90
|
+
export const isElementBySelectorInDocument = selector => {
|
|
91
|
+
return Boolean(document.querySelector(selector));
|
|
92
|
+
};
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/editor.js
CHANGED
|
@@ -173,6 +173,13 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* @private
|
|
179
|
+
* @deprecated - Do not override this at all, this is an anti-pattern.
|
|
180
|
+
* Please reach out to the Editor team if you were previously using this
|
|
181
|
+
* and need to find a workaround.
|
|
182
|
+
*/
|
|
176
183
|
}, {
|
|
177
184
|
key: "trackEditorActions",
|
|
178
185
|
value: function trackEditorActions(editorActions, props) {
|
|
@@ -259,9 +266,23 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
259
266
|
}
|
|
260
267
|
return editorActions;
|
|
261
268
|
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* @private
|
|
272
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
273
|
+
* Please reach out to the Editor team if you were previously using this
|
|
274
|
+
* and need to find a workaround.
|
|
275
|
+
*/
|
|
262
276
|
}, {
|
|
263
277
|
key: "onEditorCreated",
|
|
264
|
-
value:
|
|
278
|
+
value:
|
|
279
|
+
/**
|
|
280
|
+
* @private
|
|
281
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
282
|
+
* Please reach out to the Editor team if you were previously using this
|
|
283
|
+
* and need to find a workaround.
|
|
284
|
+
*/
|
|
285
|
+
function onEditorCreated(instance) {
|
|
265
286
|
var _this$props$featureFl2;
|
|
266
287
|
this.registerEditorForActions(instance.view, instance.eventDispatcher, instance.transformer);
|
|
267
288
|
if ((_this$props$featureFl2 = this.props.featureFlags) !== null && _this$props$featureFl2 !== void 0 && _this$props$featureFl2.ufo) {
|
|
@@ -365,6 +386,13 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
365
386
|
console.warn("\"allowMoreTextColors\" field of \"allowTextColor\" property is deprecated. It will be removedin editor-core@".concat(nextVersion, ". The color palette now shows more colors by default."));
|
|
366
387
|
}
|
|
367
388
|
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* @private
|
|
392
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
393
|
+
* Please reach out to the Editor team if you were previously using this
|
|
394
|
+
* and need to find a workaround.
|
|
395
|
+
*/
|
|
368
396
|
}, {
|
|
369
397
|
key: "onEditorDestroyed",
|
|
370
398
|
value: function onEditorDestroyed(_instance) {
|
|
@@ -436,6 +464,13 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
436
464
|
value: function getBaseFontSize() {
|
|
437
465
|
return !['comment', 'chromeless', 'mobile'].includes(this.props.appearance) ? akEditorFullPageDefaultFontSize : undefined;
|
|
438
466
|
}
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* @private
|
|
470
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
471
|
+
* Please reach out to the Editor team if you were previously using this
|
|
472
|
+
* and need to find a workaround.
|
|
473
|
+
*/
|
|
439
474
|
}, {
|
|
440
475
|
key: "render",
|
|
441
476
|
value: function render() {
|
package/dist/esm/test-utils.js
CHANGED
|
@@ -89,4 +89,14 @@ export function setTextSelection(view, anchor, head) {
|
|
|
89
89
|
var state = view.state;
|
|
90
90
|
var tr = state.tr.setSelection(TextSelection.create(state.doc, anchor, head));
|
|
91
91
|
view.dispatch(tr);
|
|
92
|
-
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Given a selector, checks if an element matching the selector exists in the
|
|
96
|
+
* document.
|
|
97
|
+
* @param selector
|
|
98
|
+
* @returns true if element matching selector exists in document, false otherwise
|
|
99
|
+
*/
|
|
100
|
+
export var isElementBySelectorInDocument = function isElementBySelectorInDocument(selector) {
|
|
101
|
+
return Boolean(document.querySelector(selector));
|
|
102
|
+
};
|
package/dist/esm/version.json
CHANGED
package/dist/types/editor.d.ts
CHANGED
|
@@ -38,6 +38,12 @@ export default class Editor extends React.Component<EditorProps, State> {
|
|
|
38
38
|
componentDidMount(): void;
|
|
39
39
|
componentDidUpdate(prevProps: EditorProps): void;
|
|
40
40
|
componentWillUnmount(): void;
|
|
41
|
+
/**
|
|
42
|
+
* @private
|
|
43
|
+
* @deprecated - Do not override this at all, this is an anti-pattern.
|
|
44
|
+
* Please reach out to the Editor team if you were previously using this
|
|
45
|
+
* and need to find a workaround.
|
|
46
|
+
*/
|
|
41
47
|
trackEditorActions(editorActions: EditorActions & {
|
|
42
48
|
_contentRetrievalTracking?: {
|
|
43
49
|
getValueTracked: boolean;
|
|
@@ -55,8 +61,26 @@ export default class Editor extends React.Component<EditorProps, State> {
|
|
|
55
61
|
};
|
|
56
62
|
} | undefined;
|
|
57
63
|
};
|
|
64
|
+
/**
|
|
65
|
+
* @private
|
|
66
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
67
|
+
* Please reach out to the Editor team if you were previously using this
|
|
68
|
+
* and need to find a workaround.
|
|
69
|
+
*/
|
|
58
70
|
prepareExtensionProvider: import("memoize-one").MemoizedFn<(extensionProviders?: ExtensionProvidersProp | undefined) => ExtensionProvider<any> | undefined>;
|
|
71
|
+
/**
|
|
72
|
+
* @private
|
|
73
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
74
|
+
* Please reach out to the Editor team if you were previously using this
|
|
75
|
+
* and need to find a workaround.
|
|
76
|
+
*/
|
|
59
77
|
prepareQuickInsertProvider: (extensionProvider?: ExtensionProvider<any> | undefined, quickInsert?: QuickInsertOptions | undefined) => Promise<QuickInsertProvider> | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* @private
|
|
80
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
81
|
+
* Please reach out to the Editor team if you were previously using this
|
|
82
|
+
* and need to find a workaround.
|
|
83
|
+
*/
|
|
60
84
|
onEditorCreated(instance: {
|
|
61
85
|
view: EditorView;
|
|
62
86
|
eventDispatcher: EventDispatcher;
|
|
@@ -64,6 +88,12 @@ export default class Editor extends React.Component<EditorProps, State> {
|
|
|
64
88
|
}): void;
|
|
65
89
|
private sendDurationAnalytics;
|
|
66
90
|
private deprecationWarnings;
|
|
91
|
+
/**
|
|
92
|
+
* @private
|
|
93
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
94
|
+
* Please reach out to the Editor team if you were previously using this
|
|
95
|
+
* and need to find a workaround.
|
|
96
|
+
*/
|
|
67
97
|
onEditorDestroyed(_instance: {
|
|
68
98
|
view: EditorView;
|
|
69
99
|
transformer?: Transformer<string>;
|
|
@@ -72,7 +102,19 @@ export default class Editor extends React.Component<EditorProps, State> {
|
|
|
72
102
|
private unregisterEditorFromActions;
|
|
73
103
|
private handleProviders;
|
|
74
104
|
private getBaseFontSize;
|
|
105
|
+
/**
|
|
106
|
+
* @private
|
|
107
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
108
|
+
* Please reach out to the Editor team if you were previously using this
|
|
109
|
+
* and need to find a workaround.
|
|
110
|
+
*/
|
|
75
111
|
handleSave: (view: EditorView) => void;
|
|
112
|
+
/**
|
|
113
|
+
* @private
|
|
114
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
115
|
+
* Please reach out to the Editor team if you were previously using this
|
|
116
|
+
* and need to find a workaround.
|
|
117
|
+
*/
|
|
76
118
|
handleAnalyticsEvent: FireAnalyticsCallback;
|
|
77
119
|
render(): jsx.JSX.Element;
|
|
78
120
|
}
|
|
@@ -28,3 +28,10 @@ export { EventDispatcher } from './event-dispatcher';
|
|
|
28
28
|
export type { Dispatch } from './event-dispatcher';
|
|
29
29
|
export { GapCursorSelection, Side as GapCursorSide, } from './plugins/selection/gap-cursor/selection';
|
|
30
30
|
export declare function setTextSelection(view: EditorView, anchor: number, head?: number): void;
|
|
31
|
+
/**
|
|
32
|
+
* Given a selector, checks if an element matching the selector exists in the
|
|
33
|
+
* document.
|
|
34
|
+
* @param selector
|
|
35
|
+
* @returns true if element matching selector exists in document, false otherwise
|
|
36
|
+
*/
|
|
37
|
+
export declare const isElementBySelectorInDocument: (selector: string) => boolean;
|