@atlaskit/editor-plugin-breakout 2.6.0 → 2.7.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 +22 -0
- package/dist/cjs/breakoutPlugin.js +9 -7
- package/dist/cjs/pm-plugins/pragmatic-resizer.js +91 -16
- package/dist/cjs/pm-plugins/resizer-callbacks.js +50 -12
- package/dist/cjs/pm-plugins/resizing-mark-view.js +11 -4
- package/dist/cjs/pm-plugins/resizing-plugin.js +2 -2
- package/dist/cjs/pm-plugins/utils/analytics.js +23 -0
- package/dist/cjs/pm-plugins/utils/measure-framerate.js +122 -0
- package/dist/es2019/breakoutPlugin.js +4 -1
- package/dist/es2019/pm-plugins/pragmatic-resizer.js +75 -9
- package/dist/es2019/pm-plugins/resizer-callbacks.js +47 -6
- package/dist/es2019/pm-plugins/resizing-mark-view.js +9 -3
- package/dist/es2019/pm-plugins/resizing-plugin.js +2 -2
- package/dist/es2019/pm-plugins/utils/analytics.js +15 -0
- package/dist/es2019/pm-plugins/utils/measure-framerate.js +109 -0
- package/dist/esm/breakoutPlugin.js +9 -7
- package/dist/esm/pm-plugins/pragmatic-resizer.js +88 -15
- package/dist/esm/pm-plugins/resizer-callbacks.js +50 -12
- package/dist/esm/pm-plugins/resizing-mark-view.js +11 -4
- package/dist/esm/pm-plugins/resizing-plugin.js +2 -2
- package/dist/esm/pm-plugins/utils/analytics.js +17 -0
- package/dist/esm/pm-plugins/utils/measure-framerate.js +116 -0
- package/dist/types/breakoutPluginType.d.ts +3 -1
- package/dist/types/pm-plugins/pragmatic-resizer.d.ts +6 -1
- package/dist/types/pm-plugins/resizing-mark-view.d.ts +8 -2
- package/dist/types/pm-plugins/resizing-plugin.d.ts +3 -1
- package/dist/types/pm-plugins/utils/analytics.d.ts +7 -0
- package/dist/types/pm-plugins/utils/measure-framerate.d.ts +30 -0
- package/dist/types-ts4.5/breakoutPluginType.d.ts +3 -1
- package/dist/types-ts4.5/pm-plugins/pragmatic-resizer.d.ts +6 -1
- package/dist/types-ts4.5/pm-plugins/resizing-mark-view.d.ts +8 -2
- package/dist/types-ts4.5/pm-plugins/resizing-plugin.d.ts +3 -1
- package/dist/types-ts4.5/pm-plugins/utils/analytics.d.ts +7 -0
- package/dist/types-ts4.5/pm-plugins/utils/measure-framerate.d.ts +30 -0
- package/package.json +7 -5
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Measure the FPS of a resizing component.
|
|
3
|
+
*
|
|
4
|
+
* This is a simplified version of the `useMeasureFramerate` hook from `editor-plugin-table`.
|
|
5
|
+
* (packages/editor/editor-plugin-table/src/pm-plugins/utils/analytics.ts)
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export var reduceResizeFrameRateSamples = function reduceResizeFrameRateSamples(frameRateSamples) {
|
|
9
|
+
if (frameRateSamples.length > 1) {
|
|
10
|
+
var frameRateSum = frameRateSamples.reduce(function (sum, frameRate, index) {
|
|
11
|
+
if (index === 0) {
|
|
12
|
+
return sum;
|
|
13
|
+
} else {
|
|
14
|
+
return sum + frameRate;
|
|
15
|
+
}
|
|
16
|
+
}, 0);
|
|
17
|
+
var averageFrameRate = Math.round(frameRateSum / (frameRateSamples.length - 1));
|
|
18
|
+
return [frameRateSamples[0], averageFrameRate];
|
|
19
|
+
} else {
|
|
20
|
+
return frameRateSamples;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Measures the framerate of a component over a given time period.
|
|
25
|
+
* @param {object} [config] - Configuration options for framerate measurement.
|
|
26
|
+
* @returns {object} An object containing startMeasure, endMeasure, and countFrames methods.
|
|
27
|
+
* @example
|
|
28
|
+
* const { startMeasure, endMeasure, countFrames } = measureFramerate();
|
|
29
|
+
* startMeasure();
|
|
30
|
+
* // ... animation loop with countFrames() calls
|
|
31
|
+
* const samples = endMeasure(); // [60, 58, 62]
|
|
32
|
+
*/
|
|
33
|
+
export var measureFramerate = function measureFramerate(config) {
|
|
34
|
+
var _ref = config || {},
|
|
35
|
+
_ref$maxSamples = _ref.maxSamples,
|
|
36
|
+
maxSamples = _ref$maxSamples === void 0 ? 10 : _ref$maxSamples,
|
|
37
|
+
_ref$minFrames = _ref.minFrames,
|
|
38
|
+
minFrames = _ref$minFrames === void 0 ? 5 : _ref$minFrames,
|
|
39
|
+
_ref$minTimeMs = _ref.minTimeMs,
|
|
40
|
+
minTimeMs = _ref$minTimeMs === void 0 ? 500 : _ref$minTimeMs,
|
|
41
|
+
_ref$sampleRateMs = _ref.sampleRateMs,
|
|
42
|
+
sampleRateMs = _ref$sampleRateMs === void 0 ? 1000 : _ref$sampleRateMs,
|
|
43
|
+
_ref$timeoutMs = _ref.timeoutMs,
|
|
44
|
+
timeoutMs = _ref$timeoutMs === void 0 ? 200 : _ref$timeoutMs;
|
|
45
|
+
var frameCount = 0;
|
|
46
|
+
var lastTime = 0;
|
|
47
|
+
var timeoutId;
|
|
48
|
+
var frameRateSamples = [];
|
|
49
|
+
var startMeasure = function startMeasure() {
|
|
50
|
+
frameCount = 0;
|
|
51
|
+
lastTime = performance.now();
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Returns an array of frame rate samples as integers.
|
|
56
|
+
* @returns {number[]} An array of frame rate samples as integers.
|
|
57
|
+
* @example
|
|
58
|
+
* const samples = endMeasure(); // [60, 58, 62]
|
|
59
|
+
*/
|
|
60
|
+
var endMeasure = function endMeasure() {
|
|
61
|
+
var samples = frameRateSamples;
|
|
62
|
+
frameRateSamples = [];
|
|
63
|
+
return samples;
|
|
64
|
+
};
|
|
65
|
+
var sampleFrameRate = function sampleFrameRate() {
|
|
66
|
+
var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
67
|
+
var currentTime = performance.now();
|
|
68
|
+
var deltaTime = currentTime - lastTime - delay;
|
|
69
|
+
var isValidSample = deltaTime > minTimeMs && frameCount >= minFrames;
|
|
70
|
+
if (isValidSample) {
|
|
71
|
+
var frameRate = Math.round(frameCount / (deltaTime / 1000));
|
|
72
|
+
frameRateSamples.push(frameRate);
|
|
73
|
+
}
|
|
74
|
+
frameCount = 0;
|
|
75
|
+
lastTime = 0;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Counts the number of frames that occur within a given time period. Intended to be called
|
|
80
|
+
* inside a `requestAnimationFrame` callback.
|
|
81
|
+
* @example
|
|
82
|
+
* const animate = () => {
|
|
83
|
+
* countFrames();
|
|
84
|
+
* requestAnimationFrame(animate);
|
|
85
|
+
* };
|
|
86
|
+
*/
|
|
87
|
+
var countFrames = function countFrames() {
|
|
88
|
+
if (frameRateSamples.length >= maxSamples && timeoutId) {
|
|
89
|
+
clearTimeout(timeoutId);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Allows us to keep counting frames even if `startMeasure` is not called
|
|
95
|
+
*/
|
|
96
|
+
if (lastTime === 0) {
|
|
97
|
+
lastTime = performance.now();
|
|
98
|
+
}
|
|
99
|
+
frameCount++;
|
|
100
|
+
if (timeoutId) {
|
|
101
|
+
clearTimeout(timeoutId);
|
|
102
|
+
}
|
|
103
|
+
if (performance.now() - lastTime > sampleRateMs) {
|
|
104
|
+
sampleFrameRate();
|
|
105
|
+
} else {
|
|
106
|
+
timeoutId = setTimeout(function () {
|
|
107
|
+
return sampleFrameRate(timeoutMs);
|
|
108
|
+
}, timeoutMs);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
return {
|
|
112
|
+
startMeasure: startMeasure,
|
|
113
|
+
endMeasure: endMeasure,
|
|
114
|
+
countFrames: countFrames
|
|
115
|
+
};
|
|
116
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
2
3
|
import { type BlockControlsPlugin } from '@atlaskit/editor-plugin-block-controls';
|
|
3
4
|
import { type EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
4
5
|
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
@@ -20,7 +21,8 @@ export type BreakoutPluginDependencies = [
|
|
|
20
21
|
OptionalPlugin<BlockControlsPlugin>,
|
|
21
22
|
OptionalPlugin<InteractionPlugin>,
|
|
22
23
|
OptionalPlugin<UserIntentPlugin>,
|
|
23
|
-
OptionalPlugin<GuidelinePlugin
|
|
24
|
+
OptionalPlugin<GuidelinePlugin>,
|
|
25
|
+
OptionalPlugin<AnalyticsPlugin>
|
|
24
26
|
];
|
|
25
27
|
export type BreakoutPlugin = NextEditorPlugin<'breakout', {
|
|
26
28
|
pluginConfiguration: BreakoutPluginOptions | undefined;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import type { IntlShape, MessageDescriptor } from 'react-intl-next';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
1
3
|
import type { BaseEventPayload, ElementDragType } from '@atlaskit/pragmatic-drag-and-drop/types';
|
|
2
|
-
export declare const
|
|
4
|
+
export declare const resizeHandleMessage: Record<string, MessageDescriptor>;
|
|
5
|
+
export declare const createPragmaticResizer: ({ target, onDragStart, onDrag, onDrop, intl, nodeViewPortalProviderAPI, }: {
|
|
3
6
|
target: HTMLElement;
|
|
4
7
|
onDragStart: (args: BaseEventPayload<ElementDragType>) => void;
|
|
5
8
|
onDrag: (args: BaseEventPayload<ElementDragType>) => void;
|
|
6
9
|
onDrop: (args: BaseEventPayload<ElementDragType>) => void;
|
|
10
|
+
intl: IntlShape;
|
|
11
|
+
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
7
12
|
}) => {
|
|
8
13
|
rightHandle: HTMLDivElement;
|
|
9
14
|
leftHandle: HTMLDivElement;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
1
3
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
4
|
import type { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
3
5
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -9,16 +11,20 @@ export declare class ResizingMarkView implements NodeView {
|
|
|
9
11
|
view: EditorView;
|
|
10
12
|
mark: Mark;
|
|
11
13
|
destroyFn: () => void;
|
|
14
|
+
intl: IntlShape;
|
|
15
|
+
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
12
16
|
/**
|
|
13
17
|
* Wrap node view in a resizing mark view
|
|
14
18
|
* @param {Mark} mark - The breakout mark to resize
|
|
15
19
|
* @param {EditorView} view - The editor view
|
|
16
|
-
* @param {ExtractInjectionAPI<BreakoutPlugin> | undefined} api -
|
|
20
|
+
* @param {ExtractInjectionAPI<BreakoutPlugin> | undefined} api - The pluginInjectionAPI
|
|
21
|
+
* @param {Function} getIntl - () => IntlShape
|
|
22
|
+
* @param {PortalProviderAPI} - The nodeViewPortalProviderAPI
|
|
17
23
|
* @example
|
|
18
24
|
* ```ts
|
|
19
25
|
* ```
|
|
20
26
|
*/
|
|
21
|
-
constructor(mark: Mark, view: EditorView, api: ExtractInjectionAPI<BreakoutPlugin> | undefined);
|
|
27
|
+
constructor(mark: Mark, view: EditorView, api: ExtractInjectionAPI<BreakoutPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI);
|
|
22
28
|
ignoreMutation(): boolean;
|
|
23
29
|
destroy(): void;
|
|
24
30
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
1
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
4
|
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
6
|
import { BreakoutPlugin } from '../breakoutPluginType';
|
|
5
7
|
import type { BreakoutPluginOptions } from '../breakoutPluginType';
|
|
6
8
|
export declare const resizingPluginKey: PluginKey<any>;
|
|
7
|
-
export declare const createResizingPlugin: (api: ExtractInjectionAPI<BreakoutPlugin> | undefined, options?: BreakoutPluginOptions) => SafePlugin<any>;
|
|
9
|
+
export declare const createResizingPlugin: (api: ExtractInjectionAPI<BreakoutPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI, options?: BreakoutPluginOptions) => SafePlugin<any>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BreakoutEventPayload } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
export declare const generateResizeFrameRatePayloads: (props: {
|
|
4
|
+
docSize: number;
|
|
5
|
+
frameRateSamples: number[];
|
|
6
|
+
originalNode: PMNode;
|
|
7
|
+
}) => BreakoutEventPayload[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Measure the FPS of a resizing component.
|
|
3
|
+
*
|
|
4
|
+
* This is a simplified version of the `useMeasureFramerate` hook from `editor-plugin-table`.
|
|
5
|
+
* (packages/editor/editor-plugin-table/src/pm-plugins/utils/analytics.ts)
|
|
6
|
+
*/
|
|
7
|
+
export declare const reduceResizeFrameRateSamples: (frameRateSamples: number[]) => number[];
|
|
8
|
+
type MeasureFramerateConfig = {
|
|
9
|
+
maxSamples?: number;
|
|
10
|
+
minFrames?: number;
|
|
11
|
+
minTimeMs?: number;
|
|
12
|
+
sampleRateMs?: number;
|
|
13
|
+
timeoutMs?: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Measures the framerate of a component over a given time period.
|
|
17
|
+
* @param {object} [config] - Configuration options for framerate measurement.
|
|
18
|
+
* @returns {object} An object containing startMeasure, endMeasure, and countFrames methods.
|
|
19
|
+
* @example
|
|
20
|
+
* const { startMeasure, endMeasure, countFrames } = measureFramerate();
|
|
21
|
+
* startMeasure();
|
|
22
|
+
* // ... animation loop with countFrames() calls
|
|
23
|
+
* const samples = endMeasure(); // [60, 58, 62]
|
|
24
|
+
*/
|
|
25
|
+
export declare const measureFramerate: (config?: MeasureFramerateConfig) => {
|
|
26
|
+
startMeasure: () => void;
|
|
27
|
+
endMeasure: () => number[];
|
|
28
|
+
countFrames: () => void;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
2
3
|
import { type BlockControlsPlugin } from '@atlaskit/editor-plugin-block-controls';
|
|
3
4
|
import { type EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
4
5
|
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
@@ -20,7 +21,8 @@ export type BreakoutPluginDependencies = [
|
|
|
20
21
|
OptionalPlugin<BlockControlsPlugin>,
|
|
21
22
|
OptionalPlugin<InteractionPlugin>,
|
|
22
23
|
OptionalPlugin<UserIntentPlugin>,
|
|
23
|
-
OptionalPlugin<GuidelinePlugin
|
|
24
|
+
OptionalPlugin<GuidelinePlugin>,
|
|
25
|
+
OptionalPlugin<AnalyticsPlugin>
|
|
24
26
|
];
|
|
25
27
|
export type BreakoutPlugin = NextEditorPlugin<'breakout', {
|
|
26
28
|
pluginConfiguration: BreakoutPluginOptions | undefined;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import type { IntlShape, MessageDescriptor } from 'react-intl-next';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
1
3
|
import type { BaseEventPayload, ElementDragType } from '@atlaskit/pragmatic-drag-and-drop/types';
|
|
2
|
-
export declare const
|
|
4
|
+
export declare const resizeHandleMessage: Record<string, MessageDescriptor>;
|
|
5
|
+
export declare const createPragmaticResizer: ({ target, onDragStart, onDrag, onDrop, intl, nodeViewPortalProviderAPI, }: {
|
|
3
6
|
target: HTMLElement;
|
|
4
7
|
onDragStart: (args: BaseEventPayload<ElementDragType>) => void;
|
|
5
8
|
onDrag: (args: BaseEventPayload<ElementDragType>) => void;
|
|
6
9
|
onDrop: (args: BaseEventPayload<ElementDragType>) => void;
|
|
10
|
+
intl: IntlShape;
|
|
11
|
+
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
7
12
|
}) => {
|
|
8
13
|
rightHandle: HTMLDivElement;
|
|
9
14
|
leftHandle: HTMLDivElement;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
1
3
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
4
|
import type { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
3
5
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -9,16 +11,20 @@ export declare class ResizingMarkView implements NodeView {
|
|
|
9
11
|
view: EditorView;
|
|
10
12
|
mark: Mark;
|
|
11
13
|
destroyFn: () => void;
|
|
14
|
+
intl: IntlShape;
|
|
15
|
+
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
12
16
|
/**
|
|
13
17
|
* Wrap node view in a resizing mark view
|
|
14
18
|
* @param {Mark} mark - The breakout mark to resize
|
|
15
19
|
* @param {EditorView} view - The editor view
|
|
16
|
-
* @param {ExtractInjectionAPI<BreakoutPlugin> | undefined} api -
|
|
20
|
+
* @param {ExtractInjectionAPI<BreakoutPlugin> | undefined} api - The pluginInjectionAPI
|
|
21
|
+
* @param {Function} getIntl - () => IntlShape
|
|
22
|
+
* @param {PortalProviderAPI} - The nodeViewPortalProviderAPI
|
|
17
23
|
* @example
|
|
18
24
|
* ```ts
|
|
19
25
|
* ```
|
|
20
26
|
*/
|
|
21
|
-
constructor(mark: Mark, view: EditorView, api: ExtractInjectionAPI<BreakoutPlugin> | undefined);
|
|
27
|
+
constructor(mark: Mark, view: EditorView, api: ExtractInjectionAPI<BreakoutPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI);
|
|
22
28
|
ignoreMutation(): boolean;
|
|
23
29
|
destroy(): void;
|
|
24
30
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
1
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
4
|
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
6
|
import { BreakoutPlugin } from '../breakoutPluginType';
|
|
5
7
|
import type { BreakoutPluginOptions } from '../breakoutPluginType';
|
|
6
8
|
export declare const resizingPluginKey: PluginKey<any>;
|
|
7
|
-
export declare const createResizingPlugin: (api: ExtractInjectionAPI<BreakoutPlugin> | undefined, options?: BreakoutPluginOptions) => SafePlugin<any>;
|
|
9
|
+
export declare const createResizingPlugin: (api: ExtractInjectionAPI<BreakoutPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI, options?: BreakoutPluginOptions) => SafePlugin<any>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BreakoutEventPayload } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
export declare const generateResizeFrameRatePayloads: (props: {
|
|
4
|
+
docSize: number;
|
|
5
|
+
frameRateSamples: number[];
|
|
6
|
+
originalNode: PMNode;
|
|
7
|
+
}) => BreakoutEventPayload[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Measure the FPS of a resizing component.
|
|
3
|
+
*
|
|
4
|
+
* This is a simplified version of the `useMeasureFramerate` hook from `editor-plugin-table`.
|
|
5
|
+
* (packages/editor/editor-plugin-table/src/pm-plugins/utils/analytics.ts)
|
|
6
|
+
*/
|
|
7
|
+
export declare const reduceResizeFrameRateSamples: (frameRateSamples: number[]) => number[];
|
|
8
|
+
type MeasureFramerateConfig = {
|
|
9
|
+
maxSamples?: number;
|
|
10
|
+
minFrames?: number;
|
|
11
|
+
minTimeMs?: number;
|
|
12
|
+
sampleRateMs?: number;
|
|
13
|
+
timeoutMs?: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Measures the framerate of a component over a given time period.
|
|
17
|
+
* @param {object} [config] - Configuration options for framerate measurement.
|
|
18
|
+
* @returns {object} An object containing startMeasure, endMeasure, and countFrames methods.
|
|
19
|
+
* @example
|
|
20
|
+
* const { startMeasure, endMeasure, countFrames } = measureFramerate();
|
|
21
|
+
* startMeasure();
|
|
22
|
+
* // ... animation loop with countFrames() calls
|
|
23
|
+
* const samples = endMeasure(); // [60, 58, 62]
|
|
24
|
+
*/
|
|
25
|
+
export declare const measureFramerate: (config?: MeasureFramerateConfig) => {
|
|
26
|
+
startMeasure: () => void;
|
|
27
|
+
endMeasure: () => number[];
|
|
28
|
+
countFrames: () => void;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-breakout",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Breakout plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
37
|
-
"@atlaskit/editor-common": "^106.
|
|
38
|
-
"@atlaskit/editor-plugin-block-controls": "^3.
|
|
37
|
+
"@atlaskit/editor-common": "^106.5.0",
|
|
38
|
+
"@atlaskit/editor-plugin-block-controls": "^3.16.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-editor-viewmode": "^4.0.0",
|
|
41
41
|
"@atlaskit/editor-plugin-guideline": "^2.0.0",
|
|
@@ -48,12 +48,14 @@
|
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
49
49
|
"@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
|
|
50
50
|
"@atlaskit/theme": "^18.0.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^6.0.0",
|
|
52
52
|
"@atlaskit/tokens": "^5.1.0",
|
|
53
|
+
"@atlaskit/tooltip": "^20.3.0",
|
|
53
54
|
"@babel/runtime": "^7.0.0",
|
|
54
55
|
"@emotion/react": "^11.7.1",
|
|
55
56
|
"bind-event-listener": "^3.0.0",
|
|
56
|
-
"memoize-one": "^6.0.0"
|
|
57
|
+
"memoize-one": "^6.0.0",
|
|
58
|
+
"uuid": "^3.1.0"
|
|
57
59
|
},
|
|
58
60
|
"peerDependencies": {
|
|
59
61
|
"react": "^18.2.0",
|