@atlaskit/editor-core 203.11.2 → 203.11.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/create-editor/ReactEditorViewNext.js +0 -2
- package/dist/cjs/use-preset.js +3 -15
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorViewNext.js +0 -2
- package/dist/es2019/use-preset.js +3 -15
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorViewNext.js +0 -2
- package/dist/esm/use-preset.js +3 -15
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/create-editor/create-universal-preset.d.ts +2 -0
- package/dist/types/presets/universal.d.ts +2 -0
- package/dist/types/presets/useUniversalPreset.d.ts +2 -0
- package/dist/types-ts4.5/create-editor/create-universal-preset.d.ts +2 -0
- package/dist/types-ts4.5/presets/universal.d.ts +2 -0
- package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +2 -0
- package/package.json +7 -10
- package/dist/cjs/create-editor/ReactEditorView/usePluginPerformanceObserver.js +0 -49
- package/dist/es2019/create-editor/ReactEditorView/usePluginPerformanceObserver.js +0 -35
- package/dist/esm/create-editor/ReactEditorView/usePluginPerformanceObserver.js +0 -43
- package/dist/types/create-editor/ReactEditorView/usePluginPerformanceObserver.d.ts +0 -5
- package/dist/types-ts4.5/create-editor/ReactEditorView/usePluginPerformanceObserver.d.ts +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 203.11.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#103029](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103029)
|
|
8
|
+
[`bd4e16fcf521d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bd4e16fcf521d) -
|
|
9
|
+
Remove analytics for time in each lifecycle.
|
|
10
|
+
- [#102929](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102929)
|
|
11
|
+
[`29b9b5aa91e94`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/29b9b5aa91e94) -
|
|
12
|
+
Cleanup feature flag to fix editor API via usePreset in Strict Mode.
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 203.11.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -39,7 +39,6 @@ var _getUAPrefix = require("./ReactEditorView/getUAPrefix");
|
|
|
39
39
|
var _handleEditorFocus = require("./ReactEditorView/handleEditorFocus");
|
|
40
40
|
var _useDispatchTransaction = require("./ReactEditorView/useDispatchTransaction");
|
|
41
41
|
var _useFireFullWidthEvent = require("./ReactEditorView/useFireFullWidthEvent");
|
|
42
|
-
var _usePluginPerformanceObserver = require("./ReactEditorView/usePluginPerformanceObserver");
|
|
43
42
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
44
43
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
45
44
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -535,7 +534,6 @@ function ReactEditorView(props) {
|
|
|
535
534
|
}
|
|
536
535
|
}, [disabled, shouldFocus, previousDisabledState]);
|
|
537
536
|
(0, _useFireFullWidthEvent.useFireFullWidthEvent)(nextAppearance, dispatchAnalyticsEvent);
|
|
538
|
-
(0, _usePluginPerformanceObserver.usePluginPerformanceObserver)(getCurrentEditorState, pluginInjectionAPI, dispatchAnalyticsEvent);
|
|
539
537
|
var editor = (0, _react.useMemo)(function () {
|
|
540
538
|
return createEditor(props.editorProps.assistiveLabel, props.editorProps.assistiveDescribedBy);
|
|
541
539
|
},
|
package/dist/cjs/use-preset.js
CHANGED
|
@@ -8,7 +8,6 @@ exports.usePreset = usePreset;
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _preset = require("@atlaskit/editor-common/preset");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
12
|
|
|
14
13
|
/**
|
|
@@ -56,21 +55,10 @@ function usePreset(createPreset) {
|
|
|
56
55
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
56
|
dependencies);
|
|
58
57
|
(0, _react.useLayoutEffect)(function () {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
}
|
|
58
|
+
return preset.apiResolver.on(function (api) {
|
|
59
|
+
setAPI(api);
|
|
60
|
+
});
|
|
64
61
|
}, [preset.apiResolver]);
|
|
65
|
-
|
|
66
|
-
// Deprecated approach (not compatible with strict mode)
|
|
67
|
-
(0, _react.useLayoutEffect)(function () {
|
|
68
|
-
if (!(0, _platformFeatureFlags.fg)('platform_editor_fix_api_strict_mode')) {
|
|
69
|
-
preset.apiPromise.then(function (api) {
|
|
70
|
-
setAPI(api);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}, [preset.apiPromise]);
|
|
74
62
|
return {
|
|
75
63
|
editorApi: editorApi,
|
|
76
64
|
preset: preset
|
|
@@ -29,7 +29,6 @@ import { getUAPrefix } from './ReactEditorView/getUAPrefix';
|
|
|
29
29
|
import { handleEditorFocus } from './ReactEditorView/handleEditorFocus';
|
|
30
30
|
import { useDispatchTransaction } from './ReactEditorView/useDispatchTransaction';
|
|
31
31
|
import { useFireFullWidthEvent } from './ReactEditorView/useFireFullWidthEvent';
|
|
32
|
-
import { usePluginPerformanceObserver } from './ReactEditorView/usePluginPerformanceObserver';
|
|
33
32
|
const EDIT_AREA_ID = 'ak-editor-textarea';
|
|
34
33
|
function ReactEditorView(props) {
|
|
35
34
|
var _media, _linking, _linking$smartLinks, _props$render, _props$render2;
|
|
@@ -508,7 +507,6 @@ function ReactEditorView(props) {
|
|
|
508
507
|
}
|
|
509
508
|
}, [disabled, shouldFocus, previousDisabledState]);
|
|
510
509
|
useFireFullWidthEvent(nextAppearance, dispatchAnalyticsEvent);
|
|
511
|
-
usePluginPerformanceObserver(getCurrentEditorState, pluginInjectionAPI, dispatchAnalyticsEvent);
|
|
512
510
|
const editor = useMemo(() => createEditor(props.editorProps.assistiveLabel, props.editorProps.assistiveDescribedBy),
|
|
513
511
|
// `createEditor` changes a little too frequently - we don't want to recreate the editor view in this case
|
|
514
512
|
// We should follow-up
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useLayoutEffect, useMemo, useState } from 'react';
|
|
2
2
|
import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
|
|
5
4
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
5
|
|
|
@@ -43,21 +42,10 @@ export function usePreset(createPreset, dependencies = []) {
|
|
|
43
42
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
44
43
|
dependencies);
|
|
45
44
|
useLayoutEffect(() => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
});
|
|
50
|
-
}
|
|
45
|
+
return preset.apiResolver.on(api => {
|
|
46
|
+
setAPI(api);
|
|
47
|
+
});
|
|
51
48
|
}, [preset.apiResolver]);
|
|
52
|
-
|
|
53
|
-
// Deprecated approach (not compatible with strict mode)
|
|
54
|
-
useLayoutEffect(() => {
|
|
55
|
-
if (!fg('platform_editor_fix_api_strict_mode')) {
|
|
56
|
-
preset.apiPromise.then(api => {
|
|
57
|
-
setAPI(api);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}, [preset.apiPromise]);
|
|
61
49
|
return {
|
|
62
50
|
editorApi,
|
|
63
51
|
preset
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "203.11.
|
|
2
|
+
export const version = "203.11.3";
|
|
@@ -33,7 +33,6 @@ import { getUAPrefix } from './ReactEditorView/getUAPrefix';
|
|
|
33
33
|
import { handleEditorFocus } from './ReactEditorView/handleEditorFocus';
|
|
34
34
|
import { useDispatchTransaction } from './ReactEditorView/useDispatchTransaction';
|
|
35
35
|
import { useFireFullWidthEvent } from './ReactEditorView/useFireFullWidthEvent';
|
|
36
|
-
import { usePluginPerformanceObserver } from './ReactEditorView/usePluginPerformanceObserver';
|
|
37
36
|
var EDIT_AREA_ID = 'ak-editor-textarea';
|
|
38
37
|
function ReactEditorView(props) {
|
|
39
38
|
var _media, _linking, _props$render, _props$render2;
|
|
@@ -525,7 +524,6 @@ function ReactEditorView(props) {
|
|
|
525
524
|
}
|
|
526
525
|
}, [disabled, shouldFocus, previousDisabledState]);
|
|
527
526
|
useFireFullWidthEvent(nextAppearance, dispatchAnalyticsEvent);
|
|
528
|
-
usePluginPerformanceObserver(getCurrentEditorState, pluginInjectionAPI, dispatchAnalyticsEvent);
|
|
529
527
|
var editor = useMemo(function () {
|
|
530
528
|
return createEditor(props.editorProps.assistiveLabel, props.editorProps.assistiveDescribedBy);
|
|
531
529
|
},
|
package/dist/esm/use-preset.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { useLayoutEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
|
|
6
5
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
6
|
|
|
@@ -50,21 +49,10 @@ export function usePreset(createPreset) {
|
|
|
50
49
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
51
50
|
dependencies);
|
|
52
51
|
useLayoutEffect(function () {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
});
|
|
57
|
-
}
|
|
52
|
+
return preset.apiResolver.on(function (api) {
|
|
53
|
+
setAPI(api);
|
|
54
|
+
});
|
|
58
55
|
}, [preset.apiResolver]);
|
|
59
|
-
|
|
60
|
-
// Deprecated approach (not compatible with strict mode)
|
|
61
|
-
useLayoutEffect(function () {
|
|
62
|
-
if (!fg('platform_editor_fix_api_strict_mode')) {
|
|
63
|
-
preset.apiPromise.then(function (api) {
|
|
64
|
-
setAPI(api);
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}, [preset.apiPromise]);
|
|
68
56
|
return {
|
|
69
57
|
editorApi: editorApi,
|
|
70
58
|
preset: preset
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "203.11.
|
|
2
|
+
export var version = "203.11.3";
|
|
@@ -179,6 +179,7 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
|
|
|
179
179
|
commands: {
|
|
180
180
|
showMediaViewer: (media: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
181
181
|
hideMediaViewer: import("@atlaskit/editor-common/types").EditorCommand;
|
|
182
|
+
trackMediaPaste: (attrs: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
182
183
|
};
|
|
183
184
|
}, import("@atlaskit/editor-plugins/media/types").MediaOptions | undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"imageUpload", {
|
|
184
185
|
actions: {
|
|
@@ -253,6 +254,7 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
|
|
|
253
254
|
commands: {
|
|
254
255
|
showMediaViewer: (media: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
255
256
|
hideMediaViewer: import("@atlaskit/editor-common/types").EditorCommand;
|
|
257
|
+
trackMediaPaste: (attrs: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
256
258
|
};
|
|
257
259
|
}, import("@atlaskit/editor-plugins/media/types").MediaOptions | undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"annotation", {
|
|
258
260
|
pluginConfiguration: import("@atlaskit/editor-plugins/annotation").AnnotationProviders | undefined;
|
|
@@ -231,6 +231,7 @@ export default function createUniversalPresetInternal({ appearance, props, featu
|
|
|
231
231
|
commands: {
|
|
232
232
|
showMediaViewer: (media: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
233
233
|
hideMediaViewer: import("@atlaskit/editor-common/types").EditorCommand;
|
|
234
|
+
trackMediaPaste: (attrs: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
234
235
|
};
|
|
235
236
|
}, import("@atlaskit/editor-plugins/media/types").MediaOptions | undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"imageUpload", {
|
|
236
237
|
actions: {
|
|
@@ -305,6 +306,7 @@ export default function createUniversalPresetInternal({ appearance, props, featu
|
|
|
305
306
|
commands: {
|
|
306
307
|
showMediaViewer: (media: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
307
308
|
hideMediaViewer: import("@atlaskit/editor-common/types").EditorCommand;
|
|
309
|
+
trackMediaPaste: (attrs: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
308
310
|
};
|
|
309
311
|
}, import("@atlaskit/editor-plugins/media/types").MediaOptions | undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"annotation", {
|
|
310
312
|
pluginConfiguration: import("@atlaskit/editor-plugins/annotation").AnnotationProviders | undefined;
|
|
@@ -179,6 +179,7 @@ export default function useUniversalPreset({ props, initialPluginConfiguration }
|
|
|
179
179
|
commands: {
|
|
180
180
|
showMediaViewer: (media: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
181
181
|
hideMediaViewer: import("@atlaskit/editor-common/types").EditorCommand;
|
|
182
|
+
trackMediaPaste: (attrs: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
182
183
|
};
|
|
183
184
|
}, import("@atlaskit/editor-plugins/media/types").MediaOptions | undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"imageUpload", {
|
|
184
185
|
actions: {
|
|
@@ -253,6 +254,7 @@ export default function useUniversalPreset({ props, initialPluginConfiguration }
|
|
|
253
254
|
commands: {
|
|
254
255
|
showMediaViewer: (media: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
255
256
|
hideMediaViewer: import("@atlaskit/editor-common/types").EditorCommand;
|
|
257
|
+
trackMediaPaste: (attrs: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
256
258
|
};
|
|
257
259
|
}, import("@atlaskit/editor-plugins/media/types").MediaOptions | undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"annotation", {
|
|
258
260
|
pluginConfiguration: import("@atlaskit/editor-plugins/annotation").AnnotationProviders | undefined;
|
|
@@ -282,6 +282,7 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
|
|
|
282
282
|
commands: {
|
|
283
283
|
showMediaViewer: (media: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
284
284
|
hideMediaViewer: import("@atlaskit/editor-common/types").EditorCommand;
|
|
285
|
+
trackMediaPaste: (attrs: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
285
286
|
};
|
|
286
287
|
}, import("@atlaskit/editor-plugins/media/types").MediaOptions | undefined> | undefined,
|
|
287
288
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"imageUpload", {
|
|
@@ -367,6 +368,7 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
|
|
|
367
368
|
commands: {
|
|
368
369
|
showMediaViewer: (media: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
369
370
|
hideMediaViewer: import("@atlaskit/editor-common/types").EditorCommand;
|
|
371
|
+
trackMediaPaste: (attrs: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
370
372
|
};
|
|
371
373
|
}, import("@atlaskit/editor-plugins/media/types").MediaOptions | undefined> | undefined,
|
|
372
374
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"annotation", {
|
|
@@ -334,6 +334,7 @@ export default function createUniversalPresetInternal({ appearance, props, featu
|
|
|
334
334
|
commands: {
|
|
335
335
|
showMediaViewer: (media: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
336
336
|
hideMediaViewer: import("@atlaskit/editor-common/types").EditorCommand;
|
|
337
|
+
trackMediaPaste: (attrs: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
337
338
|
};
|
|
338
339
|
}, import("@atlaskit/editor-plugins/media/types").MediaOptions | undefined> | undefined,
|
|
339
340
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"imageUpload", {
|
|
@@ -419,6 +420,7 @@ export default function createUniversalPresetInternal({ appearance, props, featu
|
|
|
419
420
|
commands: {
|
|
420
421
|
showMediaViewer: (media: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
421
422
|
hideMediaViewer: import("@atlaskit/editor-common/types").EditorCommand;
|
|
423
|
+
trackMediaPaste: (attrs: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
422
424
|
};
|
|
423
425
|
}, import("@atlaskit/editor-plugins/media/types").MediaOptions | undefined> | undefined,
|
|
424
426
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"annotation", {
|
|
@@ -282,6 +282,7 @@ export default function useUniversalPreset({ props, initialPluginConfiguration }
|
|
|
282
282
|
commands: {
|
|
283
283
|
showMediaViewer: (media: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
284
284
|
hideMediaViewer: import("@atlaskit/editor-common/types").EditorCommand;
|
|
285
|
+
trackMediaPaste: (attrs: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
285
286
|
};
|
|
286
287
|
}, import("@atlaskit/editor-plugins/media/types").MediaOptions | undefined> | undefined,
|
|
287
288
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"imageUpload", {
|
|
@@ -367,6 +368,7 @@ export default function useUniversalPreset({ props, initialPluginConfiguration }
|
|
|
367
368
|
commands: {
|
|
368
369
|
showMediaViewer: (media: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
369
370
|
hideMediaViewer: import("@atlaskit/editor-common/types").EditorCommand;
|
|
371
|
+
trackMediaPaste: (attrs: import("@atlaskit/adf-schema").MediaADFAttrs) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
370
372
|
};
|
|
371
373
|
}, import("@atlaskit/editor-plugins/media/types").MediaOptions | undefined> | undefined,
|
|
372
374
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"annotation", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "203.11.
|
|
3
|
+
"version": "203.11.3",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -43,19 +43,19 @@
|
|
|
43
43
|
"@atlaskit/analytics-next": "^10.2.0",
|
|
44
44
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
45
45
|
"@atlaskit/button": "^20.3.0",
|
|
46
|
-
"@atlaskit/editor-common": "^99.
|
|
46
|
+
"@atlaskit/editor-common": "^99.2.0",
|
|
47
47
|
"@atlaskit/editor-json-transformer": "^8.21.0",
|
|
48
48
|
"@atlaskit/editor-plugin-quick-insert": "1.8.3",
|
|
49
49
|
"@atlaskit/editor-plugins": "^6.4.0",
|
|
50
50
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
51
51
|
"@atlaskit/editor-shared-styles": "^3.2.0",
|
|
52
52
|
"@atlaskit/emoji": "^67.12.0",
|
|
53
|
-
"@atlaskit/icon": "^23.
|
|
53
|
+
"@atlaskit/icon": "^23.4.0",
|
|
54
54
|
"@atlaskit/media-card": "^78.18.0",
|
|
55
|
-
"@atlaskit/mention": "^23.
|
|
55
|
+
"@atlaskit/mention": "^23.8.0",
|
|
56
56
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
57
57
|
"@atlaskit/task-decision": "^17.11.0",
|
|
58
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
58
|
+
"@atlaskit/tmp-editor-statsig": "^2.35.0",
|
|
59
59
|
"@atlaskit/tokens": "^3.0.0",
|
|
60
60
|
"@atlaskit/tooltip": "^19.0.0",
|
|
61
61
|
"@atlaskit/width-detector": "^4.3.0",
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@af/editor-libra": "*",
|
|
83
83
|
"@af/visual-regression": "*",
|
|
84
|
-
"@atlaskit/adf-utils": "^19.
|
|
84
|
+
"@atlaskit/adf-utils": "^19.17.0",
|
|
85
85
|
"@atlaskit/analytics-listeners": "^8.13.0",
|
|
86
|
-
"@atlaskit/collab-provider": "10.
|
|
86
|
+
"@atlaskit/collab-provider": "10.4.0",
|
|
87
87
|
"@atlaskit/editor-plugin-annotation": "1.26.11",
|
|
88
88
|
"@atlaskit/editor-plugin-card": "^4.5.0",
|
|
89
89
|
"@atlaskit/editor-plugin-list": "^3.9.0",
|
|
@@ -302,9 +302,6 @@
|
|
|
302
302
|
"type": "boolean",
|
|
303
303
|
"referenceOnly": true
|
|
304
304
|
},
|
|
305
|
-
"platform_editor_fix_api_strict_mode": {
|
|
306
|
-
"type": "boolean"
|
|
307
|
-
},
|
|
308
305
|
"platform_editor_use_nested_table_pm_nodes": {
|
|
309
306
|
"type": "boolean",
|
|
310
307
|
"referenceOnly": true
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.usePluginPerformanceObserver = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
9
|
-
var _countNodes = require("@atlaskit/editor-common/count-nodes");
|
|
10
|
-
var _pluginPerformanceObserver = require("../../utils/performance/plugin-performance-observer");
|
|
11
|
-
var usePluginPerformanceObserver = exports.usePluginPerformanceObserver = function usePluginPerformanceObserver(getEditorState, pluginInjectionAPI, dispatchAnalyticsEvent) {
|
|
12
|
-
var onPluginObservation = (0, _react.useCallback)(function (report) {
|
|
13
|
-
var _pluginInjectionAPI$c;
|
|
14
|
-
dispatchAnalyticsEvent({
|
|
15
|
-
action: _analytics.ACTION.TRANSACTION_DISPATCHED,
|
|
16
|
-
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
17
|
-
eventType: _analytics.EVENT_TYPE.OPERATIONAL,
|
|
18
|
-
attributes: {
|
|
19
|
-
report: report,
|
|
20
|
-
participants: ((_pluginInjectionAPI$c = pluginInjectionAPI.current) === null || _pluginInjectionAPI$c === void 0 || (_pluginInjectionAPI$c = _pluginInjectionAPI$c.api().collabEdit) === null || _pluginInjectionAPI$c === void 0 || (_pluginInjectionAPI$c = _pluginInjectionAPI$c.sharedState.currentState()) === null || _pluginInjectionAPI$c === void 0 || (_pluginInjectionAPI$c = _pluginInjectionAPI$c.participants) === null || _pluginInjectionAPI$c === void 0 ? void 0 : _pluginInjectionAPI$c.size()) || 1
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}, [dispatchAnalyticsEvent, pluginInjectionAPI]);
|
|
24
|
-
var getPluginNames = (0, _react.useCallback)(function () {
|
|
25
|
-
var _getEditorState;
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
-
return (_getEditorState = getEditorState()) === null || _getEditorState === void 0 ? void 0 : _getEditorState.plugins.map(function (p) {
|
|
28
|
-
return p.key;
|
|
29
|
-
});
|
|
30
|
-
}, [getEditorState]);
|
|
31
|
-
var pluginPerformanceObserver = (0, _react.useMemo)(function () {
|
|
32
|
-
var state = getEditorState();
|
|
33
|
-
return new _pluginPerformanceObserver.PluginPerformanceObserver(function (report) {
|
|
34
|
-
return onPluginObservation(report);
|
|
35
|
-
}).withPlugins(function () {
|
|
36
|
-
return getPluginNames();
|
|
37
|
-
}).withNodeCounts(function () {
|
|
38
|
-
return state ? (0, _countNodes.countNodes)(state) : {
|
|
39
|
-
nodeCount: {},
|
|
40
|
-
extensionNodeCount: {}
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
}, [onPluginObservation, getPluginNames, getEditorState]);
|
|
44
|
-
(0, _react.useLayoutEffect)(function () {
|
|
45
|
-
return function () {
|
|
46
|
-
pluginPerformanceObserver.disconnect();
|
|
47
|
-
};
|
|
48
|
-
}, [pluginPerformanceObserver]);
|
|
49
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { useCallback, useLayoutEffect, useMemo } from 'react';
|
|
2
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import { countNodes } from '@atlaskit/editor-common/count-nodes';
|
|
4
|
-
import { PluginPerformanceObserver } from '../../utils/performance/plugin-performance-observer';
|
|
5
|
-
export const usePluginPerformanceObserver = (getEditorState, pluginInjectionAPI, dispatchAnalyticsEvent) => {
|
|
6
|
-
const onPluginObservation = useCallback(report => {
|
|
7
|
-
var _pluginInjectionAPI$c, _pluginInjectionAPI$c2, _pluginInjectionAPI$c3, _pluginInjectionAPI$c4;
|
|
8
|
-
dispatchAnalyticsEvent({
|
|
9
|
-
action: ACTION.TRANSACTION_DISPATCHED,
|
|
10
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
11
|
-
eventType: EVENT_TYPE.OPERATIONAL,
|
|
12
|
-
attributes: {
|
|
13
|
-
report,
|
|
14
|
-
participants: ((_pluginInjectionAPI$c = pluginInjectionAPI.current) === null || _pluginInjectionAPI$c === void 0 ? void 0 : (_pluginInjectionAPI$c2 = _pluginInjectionAPI$c.api().collabEdit) === null || _pluginInjectionAPI$c2 === void 0 ? void 0 : (_pluginInjectionAPI$c3 = _pluginInjectionAPI$c2.sharedState.currentState()) === null || _pluginInjectionAPI$c3 === void 0 ? void 0 : (_pluginInjectionAPI$c4 = _pluginInjectionAPI$c3.participants) === null || _pluginInjectionAPI$c4 === void 0 ? void 0 : _pluginInjectionAPI$c4.size()) || 1
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
}, [dispatchAnalyticsEvent, pluginInjectionAPI]);
|
|
18
|
-
const getPluginNames = useCallback(() => {
|
|
19
|
-
var _getEditorState;
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
-
return (_getEditorState = getEditorState()) === null || _getEditorState === void 0 ? void 0 : _getEditorState.plugins.map(p => p.key);
|
|
22
|
-
}, [getEditorState]);
|
|
23
|
-
const pluginPerformanceObserver = useMemo(() => {
|
|
24
|
-
const state = getEditorState();
|
|
25
|
-
return new PluginPerformanceObserver(report => onPluginObservation(report)).withPlugins(() => getPluginNames()).withNodeCounts(() => state ? countNodes(state) : {
|
|
26
|
-
nodeCount: {},
|
|
27
|
-
extensionNodeCount: {}
|
|
28
|
-
});
|
|
29
|
-
}, [onPluginObservation, getPluginNames, getEditorState]);
|
|
30
|
-
useLayoutEffect(() => {
|
|
31
|
-
return () => {
|
|
32
|
-
pluginPerformanceObserver.disconnect();
|
|
33
|
-
};
|
|
34
|
-
}, [pluginPerformanceObserver]);
|
|
35
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { useCallback, useLayoutEffect, useMemo } from 'react';
|
|
2
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import { countNodes } from '@atlaskit/editor-common/count-nodes';
|
|
4
|
-
import { PluginPerformanceObserver } from '../../utils/performance/plugin-performance-observer';
|
|
5
|
-
export var usePluginPerformanceObserver = function usePluginPerformanceObserver(getEditorState, pluginInjectionAPI, dispatchAnalyticsEvent) {
|
|
6
|
-
var onPluginObservation = useCallback(function (report) {
|
|
7
|
-
var _pluginInjectionAPI$c;
|
|
8
|
-
dispatchAnalyticsEvent({
|
|
9
|
-
action: ACTION.TRANSACTION_DISPATCHED,
|
|
10
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
11
|
-
eventType: EVENT_TYPE.OPERATIONAL,
|
|
12
|
-
attributes: {
|
|
13
|
-
report: report,
|
|
14
|
-
participants: ((_pluginInjectionAPI$c = pluginInjectionAPI.current) === null || _pluginInjectionAPI$c === void 0 || (_pluginInjectionAPI$c = _pluginInjectionAPI$c.api().collabEdit) === null || _pluginInjectionAPI$c === void 0 || (_pluginInjectionAPI$c = _pluginInjectionAPI$c.sharedState.currentState()) === null || _pluginInjectionAPI$c === void 0 || (_pluginInjectionAPI$c = _pluginInjectionAPI$c.participants) === null || _pluginInjectionAPI$c === void 0 ? void 0 : _pluginInjectionAPI$c.size()) || 1
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
}, [dispatchAnalyticsEvent, pluginInjectionAPI]);
|
|
18
|
-
var getPluginNames = useCallback(function () {
|
|
19
|
-
var _getEditorState;
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
-
return (_getEditorState = getEditorState()) === null || _getEditorState === void 0 ? void 0 : _getEditorState.plugins.map(function (p) {
|
|
22
|
-
return p.key;
|
|
23
|
-
});
|
|
24
|
-
}, [getEditorState]);
|
|
25
|
-
var pluginPerformanceObserver = useMemo(function () {
|
|
26
|
-
var state = getEditorState();
|
|
27
|
-
return new PluginPerformanceObserver(function (report) {
|
|
28
|
-
return onPluginObservation(report);
|
|
29
|
-
}).withPlugins(function () {
|
|
30
|
-
return getPluginNames();
|
|
31
|
-
}).withNodeCounts(function () {
|
|
32
|
-
return state ? countNodes(state) : {
|
|
33
|
-
nodeCount: {},
|
|
34
|
-
extensionNodeCount: {}
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
}, [onPluginObservation, getPluginNames, getEditorState]);
|
|
38
|
-
useLayoutEffect(function () {
|
|
39
|
-
return function () {
|
|
40
|
-
pluginPerformanceObserver.disconnect();
|
|
41
|
-
};
|
|
42
|
-
}, [pluginPerformanceObserver]);
|
|
43
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import { type EditorPluginInjectionAPI } from '@atlaskit/editor-common/preset';
|
|
4
|
-
import { type EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
export declare const usePluginPerformanceObserver: (getEditorState: () => EditorState, pluginInjectionAPI: React.MutableRefObject<EditorPluginInjectionAPI>, dispatchAnalyticsEvent: (payload: AnalyticsEventPayload) => void) => void;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import { type EditorPluginInjectionAPI } from '@atlaskit/editor-common/preset';
|
|
4
|
-
import { type EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
export declare const usePluginPerformanceObserver: (getEditorState: () => EditorState, pluginInjectionAPI: React.MutableRefObject<EditorPluginInjectionAPI>, dispatchAnalyticsEvent: (payload: AnalyticsEventPayload) => void) => void;
|